On Error Resume Next Set objNetwork=CreateObject("WScript.Network") Set objShell=CreateObject("WScript.shell") strLocation="SYR" strCustom="%userprofile%\Custom\Data" strRegPath="HKCU\" & objNetwork.UserName & "\" objShell.RegRead(strRegPath) If Err.Number Then objShell.RegWrite strRegpath,"" objShell.RegWrite strRegPath & "lastLogon",Now,"REG_SZ" objShell.RegWrite strRegpath & "location",strLocation,"REG_SZ" objShell.RegWrite strRegpath & "custom",strCustom,"REG_EXPAND_SZ"