Writing to a reg_multi_sz key from a text file
I have a text file which contains a listing of websites, one per line. This text file varies depending on department, so I cannot have the sites hard coded into my script. The script has to read the text file on every PC. The text file exists at c:\StartPages.txt
sample contents of text file:
http://www.site1.com
http://www.site2.com
http://www.site3.com
http://www.site4.com
I need to write this to a reg_multi_sz type registry key. I have read tons, and still not come up with code which works correctly.
no worries about error checking, or does the key exist etc. I have that all worked out already.
I need to write this to the following key:
HKCU\SOFTWARE\MICROSOFT\INTERNET EXPLORER\MAIN
INTO THE "SECONDARY START PAGES" KEY
Thanks to anyone who responds, I do appreciate your time.
Re: Writing to a reg_multi_sz key from a text file
I actually figured this out, and thought I would post the results in case anyone else is looking for this topic.
strKeyPath = "Software\microsoft\internet explorer\main"
strValuename2 = "Secondary Start Pages"
set objTextFile = objFSO.OpenTextFile("c:\StartPage.txt",ForReading)
strFile = objTextFile.readall
myarray = split(strFile,vbcrlf)
oReg.SetMultiStringValue HKEY_Current_user,strKeyPath, strValueName2,myarray
Re: Writing to a reg_multi_sz key from a text file
would it not be easier to send an email out with instructions? who adds this textfile to each pc?