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!

Scripting HKCU keys problem...

Status
Not open for further replies.

jbit01

MIS
Oct 31, 2003
23
US
Im trying to push out some HKCU keys via a login script but am having trouble with any account other than the administrators. I know there are restrictions on HKCU which is why im using the runas command with the administrator account to execute it. The script says that it runs sucessfully but it is writing the keys to the HKEY_USERS\DEFAULT hive instead of HKEY_CURRENT_USER. Ive verified this by checking both locations. I cant figure this out. Here is what im using...

*paste this into a .reg file

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:00000095
"NoBandCustomize"=dword:00000001
"NoControlPanel"=dword:00000001
"NoViewOnDrive"=dword:03ffffff
"NoPropertiesMyComputer"=dword:00000001
"NoNetHood"=dword:00000001

*paste this into a .cmd file

runas /user:%computername%\administrator "REGEDIT.exe Desktop_Settings.reg"

FYI - ive tried the various switches for the runas command with no luck

HELP!
 
I'm not 100% sure of all of those registry settings, but you shoud take a look at the Microsoft site and download a copy of TWEAKOMATIC which will build scripts for you for much the same content as can be set using TweakUI, which it would appear is what you are trying to do.

Mark

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top