Login Scripting The My Documents Folder - TechRepublic
General discussion
October 10, 2001 at 04:09 PM
code slammy

Login Scripting The My Documents Folder

by code slammy . Updated 24 years, 8 months ago

I am working on writing a wsh script file to map a drive to a network path(no problem there) and then assign that path to the “My Documents” Folder(problem).
I seem to be having problems getting the folder to hold that path. I find little to no help in the MSDN about assigning paths to special folders but this is what I have so far.

Set net = Wscript.CreateObject(“WScript.Network”)
Set wshShell = Wscript.CreateObject(“WScript.Shell”)

User = net.username
Computer = net.ComputerNameDomain = net.UserDomain

localName = “U:”
net.RemoveNetWorkDrive localName
RemoteName = “\\Server01\d\documents”
UpdateProfile = False

TargetLocation = net.MapNetworkDrive localName, RemoteName, UpdateProfile

WshShell.SpecialFolders.item(MyDocsPath) = TargetLocation

Any ideas would be greatly appreciated.

Thanks
Tim

This discussion is locked

All Comments