Computing.Net > Forums > Programming > Double-click with command line args

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

Reply to Message Icon

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

[HKEY_CLASSES_ROOT\*\shell\Command Line\command]
@="cmd /v /c set a= &set/p a=%1 &\"%1\" !a!||echo Errorlevel !errorlevel! returned.&pause"



Sponsored Link
Ads by Google

Response Number 1
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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Double-click with command line args

Batch file command line args www.computing.net/answers/programming/batch-file-command-line-args/4226.html

Command Line Arguments www.computing.net/answers/programming/command-line-arguments/2129.html

pass command line arg through JSP www.computing.net/answers/programming/pass-command-line-arg-through-jsp/5525.html