This script will rename the My Documents folder to "My Documents %username%"
This is to be used in our organisation for remote administration purposes and so that the users realise that this folder is their own data staore and not the place where departmental docs are kept.
Any recommendations/suggestions are welcome. I am not 1005 sure on the best practices for clearing the environment at the bottom of the script.
-------------------------------------------------------------------------------------
option explicit
dim objNetwork, objShell, strUserName, objFolder, objFolderItem
Const ssfPERSONAL = 5
Set objNetwork = CreateObject("Wscript.Network")
Set objShell = CreateObject("Shell.Application")
strUserName = objNetwork.UserName
'msgbox strUserName
Set objFolder = objShell.Namespace(ssfPERSONAL)
Set objFolderItem = objFolder.Self
objFolderItem.Name = "My Documents " & strUserName
'msgbox objFolderItem.Name
'Clears Environment Cache
Set objNetwork = nothing
Set objShell = nothing
Set objFolder = nothing
Set objFolderItem = nothing
-------------------------------------------------------------------------------------