Question : Logon script that will copy the registry from a server share to local machine, then log user off

I'm trying to write a script that will copy a .reg file to the machine being logged into from SYSVOL and then log the user off.
I'm not familiar with VBScript and did it as a .bat file shown below. It's not very clean but seems to do what it needs to. My question is if there is a better cleaner way to do this? Once the user logs in, it copies immediately then while still building the profile, logs off.


Thank you in advance.
1:
2:
3:
%systemroot%\regedit /s <filename>.reg
Sleep 100
shutdown -l

Answer : Logon script that will copy the registry from a server share to local machine, then log user off

need fewer files this way, same result
just put your keys into the script vs a separate .reg file

look here for more info on the regwrite method
http://www.devguru.com/Technologies/wsh/quickref/wshshell_RegWrite.html
1:
2:
3:
4:
5:
6:
Dim WshShell  
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\MyNewKey\", 1 ,"REG_DWORD"
WshShell.RegWrite "HKCU\MyNewKey\MyValue", "Hello world!"
wscript.sleep 100  
WshShell.run "shutdown /l"
Random Solutions  
 
programming4us programming4us