ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Idea: Run once and then delete

(1/2) > >>

usasma:
I've tried doing this myself and it doesn't work for me :(

The idea is to have a file that the user can double click on to change registry settings and it will automatically insert a registry entry that will remove the registry settings on the next reboot.

This is an attempt to enter the proxy server information from work into a computer's registry so that system can access the web.  Then, when the computer is taken home, the reboot will take care of removing the proxy settings.  This'll help us when we forget to remove the proxy before sending it home.

Even better would be a tool that would do this for all the major browsers.

Here's the registry entry that's used for starting the proxy:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="xxx.xx.xx.xx:8080"

And here's the one that's currently used to turn it off:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:0000000
"ProxyServer"=""


Thanks!
 - John


edbro:
You could create a batch file that would load the new reg setting and put it in your startup folder. Save the settings that turn off the proxy to a file named remove.reg. Don't forget the proper reg header. Then create a file named noproxy.cmd and put it in your startup folder.

noproxy.cmd
\REGED /S path to file\remove.reg

usasma:
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"

edbro:
regedit /v ProxyOn.reg
--- End quote ---
Where did the /v switch come from?  The /s switch simply tells it to execute silently. I have never heard of /v.

I get an "Invalid number of parameters" error when executing the line with xcopy in it - so the batch doesn't finish properly.

--- End quote ---
It appears you can not use an environment variable in the xcopy command. Just spell out your entire path inside quotation marks.

jgpaiva:
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

Navigation

[0] Message Index

[#] Next page

Go to full version