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

Don’t have the rights to change the registry using a script

Status
Not open for further replies.

Saavyd

MIS
May 3, 2006
13
US
I am trying to chage some registry setting in windows xp but our users do not have admin rights on the box. I am trying to create a run as script that will allow the script to run under the admin account. but my scripting skills are not very good. I would appreciate some help.

Here is the code thus far.


Option explicit

dim oShell

Dim WshShell

set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "runas /user:administrator "
WScript.Sleep 100
'Replace the string yourpassword~ below with
'the password used on your system. Include tilde
oShell.Sendkeys "y0m0mm@"


Set WshShell = WScript.CreateObject("WScript.Shell")


WshShell. RegWrite"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\*.dbf", 0, "REG_DWORD"

wshShell. RegWrite"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\*.pst", 0, "REG_DWORD"

wshShell. RegWrite"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\*.pst", 0, "REG_DWORD"

wshShell. RegWrite"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\*.dbf", 0, "REG_DWORD"

Wscript.Quit

 
Are you an administrator of the machines? If so, why not run the script remotely for the "HKEY_Local_Machine" settings? As far as the HKEY_Current_User portion, I believe they will have the rights to do that, as it is dealing with their session, and/or current settings (multiple ways of setting this up, to include domain group policy, local group policy, user activated, task schedule activated). You'll only need to do it once for each.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top