locked
reg query 'too many command line parameters' RRS feed

  • Question

  • Hiya trying to write a script to do the following but getting 'too many command line parameters'

    need to verify if software is installed, (if its not installed exit) If it is then verify the key with the ipaddress is correct and if not to overwrite with correct ip

    not sure if its quotes im missing.....any help would be appreciated....

    @echo off
    setlocal ENABLEEXTENSIONS
    set KEY_NAME="HKLM\Software\software name\ip address"
    SET VALUE_NAME="Infolink IP"
    set VALUE_DATA=10.112.x.xx

    reg query %KEY_NAME%
    If errorlevel 1 goto not_exist
    goto exist

    :exist
    reg query %KEY_NAME% /v %VALUE_NAME% /t REG_SZ /d %VALUE_DATA%

    (its at this point i get too many command line parameters)

    If errorlevel 1 goto correct
    goto edit

    :edit
    reg add %KEY_NAME% /v %VALUE_NAME% /t REG_SZ /d %VALUE_DATA% /f

    :not_exist

    :correct


    • Edited by ash115 Monday, May 27, 2013 5:55 PM
    Monday, May 27, 2013 5:53 PM

Answers

  • Something like this : http://forums.techguy.org/software-development/762757-reg-batch-file-help.html

    Arnav Sharma | Facebook | Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, May 28, 2013 4:41 PM
    Moderator
  • Try reg query /? for help.

    --pa

    Monday, May 27, 2013 10:57 PM

All replies

  • Something like this : http://forums.techguy.org/software-development/762757-reg-batch-file-help.html

    Arnav Sharma | Facebook | Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, May 28, 2013 4:41 PM
    Moderator
  • Any updates?

    Arnav Sharma | Facebook | Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, June 4, 2013 4:46 AM
    Moderator