/build/static/layout/Breadcrumb_cap_w.png

Batch File

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   [ + ] Show comments

Answers (7)

Posted by: bearden3 13 years ago
Purple Belt
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
Posted by: chichora123 13 years ago
Fourth Degree Green Belt
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
Posted by: bearden3 13 years ago
Purple Belt
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...
Posted by: chichora123 13 years ago
Fourth Degree Green Belt
0
don't know y but its not working for me dude.
Posted by: anonymous_9363 13 years ago
Red Belt
0
Who's still writing batch these days? VBScript it...
Posted by: bearden3 13 years ago
Purple Belt
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.
Posted by: aogilmor 13 years ago
9th Degree Black Belt
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ