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
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