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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login script

Status
Not open for further replies.

DazzaC

Programmer
Joined
Jun 10, 2002
Messages
209
Location
GB
I would like to create a login script to automatically append a series of entries into the system registery of all users machines. The area of the registry is

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyOverride"="172.27*;10.128.2.*;*.tm-gnet.com;10.66.27.*;"

I would like to include these exceptions.

What would be the simplest and most efficient way of doing this via a script? Has anyone got any similar samples that I could use? Thanks
 
If you don't use ZENworks, the best way is to create a registry file containing the registry change, and a batch file containing the command to add the registry file to the registry, then add this batch file to the login script like as follows (must have the # or even a @ before the command):

#Z:\RUNBATCH.BAT

The batch file would read something like:

REGEDIT /S Z:\PROXY.REG

The /S supresses any confirmation messages so the addition should be seamless. You could add the registry command direct into the login script, but I find a batch file better to manage...

-----------------------------------------------------
"It's true, its damn true!"
-----------------------------------------------------
 
Thats great thanks. It how I have done it in the past but was not sure if there was any other way aside from this.
Having applied these settings when the user logs on is there anyway that the client machine could check if the update has been applied and ignore it if it has? I.e. via an if statement using a text file?
 
Your batch file could read something like this:

--------------------------------------------------------
@ECHO OFF
IF EXIST C:\REGUPDATE.TXT GOTO END
REGEDIT /S Z:\REGUPDATE.REG
ECHO UPDATE APPLIED > C:\REGUPDATE.TXT

:END
--------------------------------------------------------

Basically, the batch file checkes to see whether a file called C:\REGUPDATE.TXT exists. If it does, the batch file does nothing. If not, the batch file will run the reg update and the ECHO statement creates the file.

-----------------------------------------------------
"It's true, its damn true!"
-----------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top