[PLUG] Samba: Map "My Documents" to Linux home directory?

Bill Barry barryb at proaxis.com
Wed Mar 10 11:19:02 UTC 2004


On Wed, Mar 10, 2004 at 11:22:33AM -0700, Matt Alexander wrote:
> On Wed, 10 Mar 2004, Mike De La Mater wrote:
> 
> > On Wed, 2004-03-10 at 10:01, Paul Heinlein wrote:
> > > > Does anyone know how to configure Samba so that the "My Documents"
> > > > folder maps to the user's home directory on the Linux server?
> > > 
> > > If you mean the "My Documents" folder on the Windows desktop, then I
> > > believe the setting is made on the client side, not within Samba.
> > 
> > Absolutely correct. Right click the shortcut onthe win desktop, change
> > the location to \\server\share and you're off like a gallon of milk. You
> > might move their docs over from the local machine, too since most of win
> > users do not understand that the folder on their desktop is not actually
> > the my documents folder. 
> 
> I was hoping Samba could setup this association automatically in their
> domain profile so I didn't have to visit each desktop...

I have done this when the Samba machine is the domain controller.
This may be more elaborate than is necessary, but it works.

in smb.conf general section you put
logon script = logon.bat

the logon.bat file on the server in the netlogon share looks like
c:\windows\wscript  \\mypdcserver\netlogon\RegChange.VBS

and the RegChange.VBS looks like
-------------
Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page","http://www.google.com","REG_SZ"
-------------

You just have to substitute the correct registry key for the location of the "My Documents" folder
I think it will be this, 
WSHSHell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","\\server\share","REG_SZ"
but I have not tested it.

Then as each user logs on, their folder location gets changed.

You should make the file permissions on the RegChange.VBS and the logon.bat pretty tight.

Bill Barry




More information about the PLUG mailing list