help with reg add fuction

Discussion in 'Scripting' started by pete0085, Aug 24, 2009.

  1. pete0085

    pete0085 Guest

    Looking for some help on a reg add batch file. I am not sure what paramaters
    need to be corrected.

    It's simple - enabled the analysis toolpak for excel.

    reg add "hkcu\software\microsoft\office\11.0\excel\options"\ /v OPEN /t
    REG_SZ /d /r "C:\Program Files\Microsoft
    Office\OFFICE11\Library\Analysis\ANALYS32.XLL" /f

    The /r is part of the data value and that is where I am running into issues.
     
    pete0085, Aug 24, 2009
    #1
    1. Advertisements

  2. pete0085

    jford Guest

    reg add "hkcu\software\microsoft\office\11.0\excel\options" /v OPEN /t REG_SZ
    /d "C:\Program Files\Microsoft Office\OFFICE11\Library\Analysis\ANALYS32.XLL"
    /f

    you have a slash outside the quote after \options"\, remove that. you also
    have a "/r" which in my instance of reg isn't valid. "/d" is the value data
    assigned to the value name of "open"
     
    jford, Aug 25, 2009
    #2
    1. Advertisements

  3. as jford mentioned, you have a slash outside the quote after
    \options"\ that should be removed.

    As to the /r being a part of the data, you need to quote the entire
    value since it has spaces, and since you want to include quotes within
    the data the quotes need to be prefixed with backslashes, like so:

    reg add "hkcu\software\microsoft\office\11.0\excel\options" /v OPEN /t
    REG_SZ /d "/r \"C:\Program Files\Microsoft
    Office\OFFICE11\Library\Analysis\ANALYS32.XLL\"" /f

    Hope this helps.
     
    Zaphod Beeblebrox, Aug 26, 2009
    #3
    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.