Sentinel7even
IS-IT--Management
I am trying use a logon script to redirect a users internet favorites to their home folder. I also want to move their current favorites folder which resides localy on their computer to their home folder. The script I came up with is
When you run this you get a permission dennied error. The weird thing is I can go in and manually move the folder withh no problems. But when trying to do it from the script I dont have permissions. Anyone got any Ideas?
Code:
Set WSHShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strHomeShare = WSHShell.ExpandEnvironmentStrings("%HOMESHARE%")
strUserProfile = WSHShell.ExpandEnvironmentStrings("%USERPROFILE%")
objFSO.MoveFolder strUserProfile & "\Favorites", strHomeshare & "\Favorites"
sFavorites = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Favorites"
WshShell.RegWrite sFavorites, strHomeshare & "\Favorites", "REG_EXPAND_SZ"
When you run this you get a permission dennied error. The weird thing is I can go in and manually move the folder withh no problems. But when trying to do it from the script I dont have permissions. Anyone got any Ideas?