/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Upon running a batch file that i created i get the following error " Too many command-line parameters"
Can someone fix this for me? Thanks in advance

REG ADD "HKCR\http\shell\open\command" /v "(Default)" /T REG_SZ /D "c:\Program Files\Mozilla Firefox\firefox.exe" -requestPending -osint -url "%1" /f
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
Hi.

You have too many double quotes for the syntax. To put a double quote inside the data, you need to use the \" sequence. Try this instead of what you wrote:

REG ADD HKCR\http\shell\open\command /v (Default) /T REG_SZ /D "\"c:\Program Files\Mozilla Firefox\firefox.exe\" -requestPending -osint -url "\"%1\"" /f"

This should give you a (Default) key with:
"c:\Program Files\Mozilla Firefox\firefox.exe" -requestPending -osint -url "%1" /f
Answered 09/22/2010 by: bearden3
Purple Belt

Please log in to comment
0
Runs fine but there should be %1 between the quotes in the end. Thanks for ur help though

Default value looks like this:
"c:\Program Files\Mozilla Firefox\firefox.exe" -requestPending -osint -url "" /f
Answered 09/22/2010 by: chichora123
Fourth Degree Green Belt

Please log in to comment
0
Uh, I don't know what you're looking at but what I'm looking at does show the %1 in both the syntax line I gave you and the example I gave you...
Answered 09/22/2010 by: bearden3
Purple Belt

Please log in to comment
0
don't know y but its not working for me dude.
Answered 09/22/2010 by: chichora123
Fourth Degree Green Belt

Please log in to comment
0
Who's still writing batch these days? VBScript it...
Answered 09/22/2010 by: VBScab
Red Belt

Please log in to comment
0
The %1 is a parameter that passes values from the command line. So, since you are running the batch file, it is looking for something from the command line to replace %1 with (which would be the first string after the batch file name). Since there is nothing on the command line (or if you are just double-clicking the batch file), it is using NULL, hence the blank double quotes ("") at the end.

So, unless you are going to run the batch file and pass a literal string of "%1" to your command line, a batch file probably isn't going to work for you. You might need to go the route of a VBScript instead.
Answered 09/22/2010 by: bearden3
Purple Belt

Please log in to comment
0
I don't see bat files much these days although I can understand their appeal for non-programmers. for me vbscript was a steep learning curve, but scriptomatic was a lifesaver. And all the free code out there. But now they say vbs is outmoded and powershell is the coming script language. c# would be good to know too.
Answered 09/22/2010 by: aogilmor
Ninth Degree Black Belt

Please log in to comment