|
-
Dec 10th, 2014, 02:41 PM
#1
Thread Starter
New Member
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.
-
Dec 10th, 2014, 03:57 PM
#2
Thread Starter
New Member
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
-
Dec 11th, 2014, 08:01 PM
#3
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?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|