Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Double-click with command line args
Name: klint Date: November 6, 2008 at 09:16:41 Pacific OS: Windows XP CPU/Ram: n/a Product: n/a
Comment:
I've just written a handy little utility that allows you to select an executable (or batch file, or any file that's associated with an executable) and right-click for the context menu and choose "Command Line". It will then give you the chance to supply command line arguments to the executable. It will also pause before it closes the window. Useful for console apps but can be used for GUI apps too. Feel free to modify and suggest any improvements etc.
To use, copy the following into a file called CommandLine.reg, then double-click it. ================8<============CUT=HERE============8<===================== Windows Registry Editor Version 5.00
Name: Holla Date: November 6, 2008 at 23:11:04 Pacific
Reply:
klint,
cool. this is very useful.
-- Holla.
0
Response Number 2
Name: Razor2.3 Date: November 7, 2008 at 01:19:25 Pacific
Reply:
I notice it depends on Delayed Expansion to be enabled from the registry. I'm not going anywhere with this, I just though I should mention it since Delayed Expansion is not enabled by default.
0
Response Number 3
Name: klint Date: November 7, 2008 at 01:57:03 Pacific
Reply:
Razor, no it doesn't depend on delayed expansion being enabled in the registry at all. The cmd.exe is passed the /v option on the command line, which turns on delayed expansion. This command will work with the default settings. There are no other dependencies.
Thanks for your reply, it was useful in prompting me to explain it a bit better.
Summary: In batch files you can refer to command line arguments with %. Example: @echo off echo j | deltree %1 > nul The %1 in the batch file will be replaced by the first argument. %0 is the batch-file itself...
Summary: No difference between char* fred and char *fred. I just code it like that out of habit. You have to keep to one declaration per variable if you do it that way. The problem comes when you have char*...
Summary: How to pass command line arguments e.g. "java -Djavax.net.ssl.keyStore=SSLStore -Djavax.net.ssl.keyStorePassword=changeit LoginServer " to java bean from a JSP page? ...