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

Update of Registry thru logon scripts

Status
Not open for further replies.

Ajb2528

Technical User
Feb 22, 2002
270
0
0
GB
Hi!!!

I need to ensure that certain registry key are set when users logon. I have created a .reg file and need to execute this when each user logs into the domain. I have added the .reg file into the

C:\WINNT\SYSVOL\sysvol\zzz.com\scripts

folder on the domain controller and have amended the users logon scripts to include the line:

REGEDIT /S C:\WINNT\SYSVOL\sysvol\zzz.com\scripts\inet1.reg

What happens is that at logon time the following error message is displayed:

Bad command or file name

There are no problems when I run the .reg file locally on the client.

Has anyone got any ideas on how to remotely update the clients registry at logon time?

The clients in question are a mix of 98/ME/2000/XP and the major key that I am trying to update is:

HKEY_CURRENT_USER

Please Help!!!!

Regards,

Alan
 
I have done this sucessfully using WSH (Windows Scripting Host). With WSH you can add and delete things from the registry (via .vbs, .js scripts). By default all the versions of Windows you list should have WSH installed. Windows 2000 & XP can use .vbs scripts as login scripts so its easy with these, for Windows 9x/ME & NT4 you can call the script host through the LOGON.BAT (or whatever you call your logon script).
If you give me your email address I can send you some samples of my logon script.

Andy
 
alanb@quantumconsultinggroup.com
 
sounds like a permission issue

are the users that are logging in, normal users or do they have higher permissions such as power users status

it's likely that ordinary users are denied having their registry edited via the login script

doing it via GP would give users elevated privileges to enable the registry to be written to the pc "Work to live, don't live to work"

"The problem with troubleshooting is that sometimes it shoots back"
 
What about using the "runas" in your script to import the values into the registry. Most likely (As was said above) the user cannot import to the registry if you have the policies set that way. -------------------------------
MCSE in training.
Currently I've gone through the following books:
70-210 Win2K Professional
70-215 Win2K Server
 
It could be that the regedit file just can't be found. I have that alot too with the simple logon scripts.
Just try this.
I would just have a folder with regedit.exe in there and share it.
Then in your logon.bat file you can say something like.
\\server\regedit\REGEDIT /S C:\WINNT\SYSVOL\sysvol\zzz.com\scripts\inet1.reg

It sounds like it can't find the regedit file.

That should do the trick I think.

pim
 
Hi,

You need to change your logon script to read:

REGEDIT /S \\zzz.com\SysVol\zzz.com\Scripts\inet1.reg

Then it will work.

When logging onto the workstation, regedit is looking on the *local* drive for the reg file.

Daniel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top