Option Explicit
Dim RegLocate, objShell, sUser
Set objShell = WScript.CreateObject("WScript.Shell")
RegLocate = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData"
sUser=objShell.ExpandEnvironmentStrings("%UserName%")
objShell.RegWrite RegLocate,"\\server2\" & sUser & "$\Application Data","REG_SZ"
RegLocate = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData"
objShell.RegWrite RegLocate,"\\server2\" & sUser & "$\Application Data","REG_SZ"
|