Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Special Folders

Status
Not open for further replies.

DantanaSwat

IS-IT--Management
Dec 3, 2003
29
US
I have users here whose 'My Documents' Folder are either pointing to thier mapped h drive to thier personal user folder on the server or pointing to thier local profile My Documents on thier desktop. How can I script it to change the c:\documents and setting\yada yada to h:\userfolder. I cand find how to change it using the WshShell SpecialFolders.Item deal.
 
I am not sure you can change it but you can view the contents of each special folder and that way know what the real path is going to. Try this script.


'Script Starts Here.
Set Shell = createobject("wscript.shell")
Set fs = CreateObject("Scripting.FileSystemObject")

special1 ="MyDocuments ="&shell.specialfolders("MyDocuments")
special2 ="AllUsersDesktop ="&shell.specialfolders("AllUsersDesktop")
special3 ="AllUsersStartMenu ="&shell.specialfolders("AllUsersStartMenu")
special4 ="AllUsersPrograms ="&shell.specialfolders("AllUsersPrograms")
special5 ="AllUsersStartup ="&shell.specialfolders("AllUsersStartup")
special6 ="Desktop ="&shell.specialfolders("Desktop")
special7 ="Favorites ="&shell.specialfolders("Favorites")
special8 ="Fonts ="&shell.specialfolders("Fonts")
special9 ="NetHood =" &shell.specialfolders("NetHood")
special10 ="PrintHood ="&shell.specialfolders("PrintHood")
special11 ="Programs ="&shell.specialfolders("Programs")
special12 ="Recent ="&shell.specialfolders("Recent")
special13 ="SendTo ="&shell.specialfolders("SendTo")
special14 ="StartMenu ="&shell.specialfolders("StartMenu")
special15 ="Startup ="&shell.specialfolders("Startup")
special16 ="Templates ="&shell.specialfolders("Templates")
Special17 ="Program Files ="&Shell.ExpandEnvironmentStrings("%ProgramFiles%")
Special18 ="Common Program Files ="&Shell.ExpandEnvironmentStrings("%CommonProgramFiles%")
Special19 = "Windows Folder = " & Fs.GetSpecialFolder(0)
Special20 = "System Folder = " & Fs.GetSpecialFolder(1)
Special21 = "Temporary Folder = " & Fs.GetSpecialFolder(2)

specialinfo=special1 & vbCr &special2& vbCr &special3& vbCr &special4& vbCr &special5& vbCr &special6& vbCr &special7& vbCr &special8& vbCr &special9& vbCr &special10& vbCr &special11& vbCr &special12& vbCr &special13& vbCr &special14& vbCr &special15 & vbCr &special16 &vbcr &special17 &vbcr &special18 &vbcr &Special19 &vbcr & Special20 &vbcr &Special21
Shell.popup SpecialInfo
 
The better way to do this is to use Folder Redirection in a GPO. Are you in an AD environment?
 
No AD yet...Im in charge of that in the next few months. The only thing I can think of is to delete the old one and add a new one and then copy thier c:\documents and settings\%username%\My Documetns folder over to thier h drive.
 
On my XP Pro machine I found the reg key I think you need.

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DocFolderPaths

Create a new Reg_Sz with the user name and give it a value equal to your new path.

Note: there are some shell folders you might want to change too, like My Music and My Pictures..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top