+ Post New Thread
Results 1 to 11 of 11
Windows Thread, Reg add command: Can someone tell me what's wrong with this please? in Technical; Hi, Simple thing. I'm trying to run the following command to add a new registry key: REG ADD HKEY_CURRENT_USER\Software\Location /v ...
  1. #1
    basicchannel's Avatar
    Join Date
    May 2010
    Location
    Norfolk, UK
    Posts
    279
    Thank Post
    36
    Thanked 23 Times in 15 Posts
    Blog Entries
    1
    Rep Power
    23

    Reg add command: Can someone tell me what's wrong with this please?

    Hi,

    Simple thing. I'm trying to run the following command to add a new registry key:

    REG ADD HKEY_CURRENT_USER\Software\Location /v ValueName /t REG_DWORD /d "\\server\serverpath" /f

    So I'm basically trying to add a REG_DWORD value with the data string of a server path.

    Anyway, everytime I get the error: "Too many command line parameters"

    but as far as I can see it conforms completely with the command format.

    Can anyone see where I might be going wrong, because I can't?

    Thanks

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,697
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by basicchannel View Post
    Hi,

    Simple thing. I'm trying to run the following command to add a new registry key:

    REG ADD HKEY_CURRENT_USER\Software\Location /v ValueName /t REG_DWORD /d "\\server\serverpath" /f

    So I'm basically trying to add a REG_DWORD value with the data string of a server path.

    Anyway, everytime I get the error: "Too many command line parameters"

    but as far as I can see it conforms completely with the command format.

    Can anyone see where I might be going wrong, because I can't?

    Thanks
    Do you have the exact line you're using? Obviously can change servernames etc, but kind of need to see the string

    Steve

  3. #3
    Ergo's Avatar
    Join Date
    Sep 2012
    Location
    Nottingham
    Posts
    111
    Thank Post
    16
    Thanked 26 Times in 25 Posts
    Rep Power
    9
    @basicchannel If you are trying to add a REG_DWORD then you have to specitfy a number in /d More likely that you want to add a REG_SZ value (String) if the data is a path to a server?

    To check that out use Regedit to manually add the value you want in the registry and then use "REG QUERY HKEY_Local_User\Software\Location /ve" to show current values in that area of the registry and their name, type and data.

    Regards

    David Irwin
    Last edited by Ergo; 18th September 2012 at 12:57 PM.

  4. Thanks to Ergo from:

    basicchannel (18th September 2012)

  5. #4
    basicchannel's Avatar
    Join Date
    May 2010
    Location
    Norfolk, UK
    Posts
    279
    Thank Post
    36
    Thanked 23 Times in 15 Posts
    Blog Entries
    1
    Rep Power
    23
    OK, I really should have been more specific, so sorry about that.

    I'm trrying to add a value to HKCU\Software\Microsoft\Office\12.0\Outlook\Setup in the form of ImportPRF to specify a prf server path for setting up Outlook profiles automatically. I assumed it should be a REG_DWORD

  6. #5

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,697
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Code:
    REG ADD HKCU\Software\Microsoft\Office\12.0\Outlook\Setup /v ImportPRF /t REG_SZ /d "\\server\serverpath" /f
    Should work. Even doing it as dword shouldn't give the error you got, unless you're copying an extra space in somewhere?

    Steve

  7. Thanks to Steve21 from:

    basicchannel (18th September 2012)

  8. #6
    basicchannel's Avatar
    Join Date
    May 2010
    Location
    Norfolk, UK
    Posts
    279
    Thank Post
    36
    Thanked 23 Times in 15 Posts
    Blog Entries
    1
    Rep Power
    23
    Quote Originally Posted by Steve21 View Post
    Code:
    REG ADD HKCU\Software\Microsoft\Office\12.0\Outlook\Setup /v ImportPRF /t REG_SZ /d "\\server\serverpath" /f
    Should work. Even doing it as dword shouldn't give the error you got, unless you're copying an extra space in somewhere?

    Steve
    Well REG_SZ worked perfectly. Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error. Very strange

  9. #7


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,028
    Thank Post
    231
    Thanked 2,699 Times in 1,994 Posts
    Rep Power
    792
    Quote Originally Posted by basicchannel View Post
    Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error.
    REG_DWORD's are usually numbers. e.g.

    Code:
    reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

  10. #8
    Ergo's Avatar
    Join Date
    Sep 2012
    Location
    Nottingham
    Posts
    111
    Thank Post
    16
    Thanked 26 Times in 25 Posts
    Rep Power
    9
    Quote Originally Posted by basicchannel View Post
    Well REG_SZ worked perfectly. Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error. Very strange
    Glad you got it sorted

    David Irwin

  11. #9
    basicchannel's Avatar
    Join Date
    May 2010
    Location
    Norfolk, UK
    Posts
    279
    Thank Post
    36
    Thanked 23 Times in 15 Posts
    Blog Entries
    1
    Rep Power
    23
    Basically I'm just being an idiot trying to add a string to a DWORD value.


  12. #10
    Ergo's Avatar
    Join Date
    Sep 2012
    Location
    Nottingham
    Posts
    111
    Thank Post
    16
    Thanked 26 Times in 25 Posts
    Rep Power
    9
    I always say - there is no such thing as a stupid question, it's just that questions help point out the daft things we are trying to do!

    Regards,

    David Irwin

  13. #11

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    9,143
    Thank Post
    596
    Thanked 1,960 Times in 1,358 Posts
    Blog Entries
    19
    Rep Power
    818
    Quote Originally Posted by basicchannel View Post
    Well REG_SZ worked perfectly. Trying to add it as a REG_DWORD failed miserably with the 'Invalid command line parameter' error. Very strange
    I was going to say it was supposed to be REG_SV but I wasn't sure and didn't want to look stupid...


SHARE:
+ Post New Thread

Similar Threads

  1. Can someone tell me what insect this is please ?
    By mattx in forum General Chat
    Replies: 6
    Last Post: 28th July 2012, 03:39 PM
  2. Can someone tell me where all my pictures have gone after moodle upgrade?
    By reggiep in forum Virtual Learning Platforms
    Replies: 2
    Last Post: 28th March 2011, 03:15 PM
  3. Can't see what is wrong with this
    By AyatollahPies in forum Scripts
    Replies: 6
    Last Post: 21st July 2010, 01:18 PM
  4. What's Wrong With This Printer?
    By enjay in forum Hardware
    Replies: 14
    Last Post: 12th February 2010, 09:41 AM
  5. Could someone tell me what this does...?
    By Chuckster in forum Scripts
    Replies: 5
    Last Post: 27th August 2008, 01:17 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •