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

Logon Script To Add Registry Value

Status
Not open for further replies.

JoeZ430

Technical User
Jan 4, 2005
51
US
Hello,

I was wondering if somebody knew how to take the following

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\
3.In the Name column, right-click the ServicePackSourcePath entry, and then click Modify.
4. In the Value data text box, type the path of the ServicePackFiles folder on your computer.

And add this with a logon script. Thanks in advance!

Joe
 
Something like this... But I couldn't find that registry key on my vista machine, so not sure it's the correct path.
Code:
Set objSh = CreateObject("WScript.Shell")
	If objSh.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath
") <> "newpath" Then
		objSh.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath
", "newpath", "REG_SZ"
	End If
Set objSh = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top