Now imagine not having to go through all that trouble. MainSoft now offers a utility, called ExecParm, which adds a right-click context menu option to any application. Run it and you'll be able to supply any command-line parameters that you like to run that application.
The ExecParm context menu appears with .EXE, .COM or .BAT files, and you can add other file types (such as shortcuts, with some limitations).
ExecParm works by calling the ShellExecute API, which is the most broadly-documented way to do this sort of thing reliably, so the program doesn't add any system hooks except for the right-click context menu entries. (In plainer language, it should play nice with most other applications you might install.)
One drawback: There's no provision in Windows Vista to supply command-line parameters to a program when you run it as Administrator. You may be able to get around this by:
- having each instance of Explorer launch in a separate process
- then launching an instance of Explorer as admin
- then right-clicking to invoke the program.
That should cause the launched program to execute in the same elevated context.
About the author: Serdar Yegulalp is editor ofWindows Insight (formerly the Windows Power Users Newsletter), a blog site devoted to hints, tips, tricks and news for users and administrators of Windows NT, Windows 2000, Windows XP, Windows Server 2003 and Vista. He has more than 12 years of experience working with Windows, and contributes regularly to SearchWinComputing.com and other TechTarget sites.