Script needed to change the SourcePath value in my Windows Server 2003 Registry

Discussion in 'Scripting' started by Spin, Sep 15, 2008.

  1. Spin

    Spin Guest

    Gurus,

    I am trying to change just the SourcePath value in my Windows Server 2003
    Registry via script. I want to change it from it's current value to
    "D:\ENGLISH\WIN2003\32BIT\ENT_WITH_SP1\I386". What kind of simple script
    would enable me to change just that one value? The path to that is:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion.
     
    Spin, Sep 15, 2008
    #1
    1. Advertisements

  2. You could do it with a one-line command, based on regedit.exe:
    http://support.microsoft.com/?kbid=310516
     
    Pegasus \(MVP\), Sep 15, 2008
    #2
    1. Advertisements

  3. Spin

    Dave Patrick Guest

    Here's an example. Set the actual paths as required but note that they're
    one level above the \i386 directory.


    Set WshShell = CreateObject("WScript.Shell")
    'Setup files
    WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows
    NT\CurrentVersion\SourcePath", "D:\ENGLISH\WIN2003\32BIT\ENT_WITH_SP1\"
    WshShell.RegWrite
    "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath",
    "D:\ENGLISH\WIN2003\32BIT\ENT_WITH_SP1\"

    'Service pack source files
    WshShell.RegWrite
    "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath",
    "D:\ENGLISH\WIN2003\32BIT\ENT_WITH_SP1\"



    --

    Regards,

    Dave Patrick ....Please no email replies - reply in newsgroup.
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    http://www.microsoft.com/protect
     
    Dave Patrick, Sep 15, 2008
    #3
  4. Dusko Savatovic, Sep 15, 2008
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.