I'm a real simpleton when it comes to writing stuff - can't figger out why this doesn't work!
Here's my batch file:
regedit /v ProxyOn.reg
xcopy ProxyOff.reg %ALLUSERSPROFILE%\*.*
regedit /s DelProxy.reg
I get an "Invalid number of parameters" error when executing the line with xcopy in it - so the batch doesn't finish properly. If I execute the batch file in a cmd window - I get an error in importing the ProxyOn.reg file also.
Here's the rest of the reg files:
ProxyOn.reg:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="xxx.xx.xx.xx:8080"
ProxyOff.reg:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:0000000
"ProxyServer"=""
DelProxy.reg:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"ProxyOff"="regedit.exe /s %ALLUSERSPROFILE%\ProxyOff.reg"
"DelProxy"="del %ALLUSERSPROFILE%\ProxyOff.reg"
Why are you using the '*.*' after the '/' ?
I'd say that this would work:
regedit /v ProxyOn.reg
xcopy ProxyOff.reg %ALLUSERSPROFILE%\
regedit /s DelProxy.reg