Results 1 to 3 of 3

Thread: Writing to a reg_multi_sz key from a text file

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2013
    Posts
    6

    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.

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2013
    Posts
    6

    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

  3. #3
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    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?
    My Github - 1d3nt

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
  •  



Click Here to Expand Forum to Full Width