Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logoff scripts editing registry.

Status
Not open for further replies.

rosena

MIS
Feb 13, 2004
15
US
I am trying to create a log off script that will change the registry entries for proxy settings and the IE home page. I am having a great deal of trouble with it.

It looks like it is running, but it does not actually change the settings. I wanted to see if I could get my suspicions confirmed. Do the current user registry settings get released before a logoff script is run, therefore the settings are not being changed.

Help would be very much appreciated.

Thank you.
 
Not quite, the logoff (and logon) script is run under SYSTEM, not the HKEY_CURRENT_USER.
 
Well, is is it possible to edit the HKEY_CURRENT_USER in a logoff script?

Thank you.
 
It is much easier to use Group Policy to enforce proxy settings.
 
Well there is a reason why I am not. We have a program that sets the proxy setting and home page for when a user is logs into our network. The issue is, is that we have notebook users who take their laptop and use it off the network and because we have proxy settings set, will not be able to access the internet. So, to reduce the number of issues with this, we wanted to create some sort of log off or shut down script which would change these settings, therefore if a user boots up their machine off the network, the proxy settings will not be set and the home page will not be set to our intranet, but rather to an internet site.

Thank you.
 
rosena,
The issue is clear now.

Set all of your office proxy settings.

Start, Run, CMD
md c:\ipprofiles
netsh interface ip dump >c:\iprofiles\office.txt
exit

Open notepad, and create a file to be called office_ip.cmd
paste the following line and save the file:

netsh -f c:\ipprofiles\office.txt

Now, Control Panel, Scheduled Tasks, office_ip.cmd, with a schedule at logon.

You can adapt the above any way you need. You can create multiple profiles for IP settings. The two keys:
i. netsh interface ip dump >name_of_profile.txt
ii. netsh -f name_of_profile.txt to change the setttings.



 
Unfortunately, that did not work... It didn't change any of the settings.

Thanks
 
It simply is not possible that a setting change would not happen after this line: netsh -f c:\ipprofiles\office.txt

Unless office.txt contained the existing settings. The only ambiguous aspect is when the change occurs: it might be true, as I have never tested it, that it reverts the changes at logon, and the settings post-logon change them again.

In this case, place the .cmd reference as the last line of the logon script, rather than use Scheduled Tasks.


 
I ran the .cmd file directly and it did not change the settings. I also, type netsh -f... into a command prompt and it did not change the settings. As well, as I added it as a log off script etc.

Thanks.
 
Thank you bcasnter, but I went to that site. This would work if I wanted to change my TCP/IP settings, but all I want to change is my proxy settings and my home page in IE.

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top