Annoyances.org
Home » Windows Me Discussion Forum » Message 1252380704 Search | Help | Home
  
Tip: Run a free scan for common Windows errors ad

re: "Open With" Command Line Switches
Monday, September 7, 2009 at 8:31 pm
Windows Me Annoyances Discussion Forum
Posted by madman420 (15 messages posted)


Well the "Open With" feature and File Type handling in Windows ME (4.90.3000) sucks. It turns out that it's actually easier to just hand-hack the registry than it is to use any other interface that Microsoft provides.

Anyway, here is a nifty solution I came up with:

1) Find the associated program in:
HKEY_CLASSES_ROOT\Applications\
qbasic.exe in my case. It may help to actually try to associate the application the normal way first (shift-right-click file, Open With -> Choose Program, browse for app, select always use this program...).

2) If you already associated the program w/ the file then there should be a "shell\open\command" branch beneath it. If not, create it (right-click -> New -> Key). Now, in the "Default" value of the "command" key, place the command to run when you select your file by double-clicking or right-click ->Open:
d:\qbasic\qbasic.exe /h %1

You should try putting the %1 inside of double-quotes like this: "%1" ...that will help your app open files and paths with spaces in them. However, with my old 16-bit MS-DOS app, it doesn't understand long filenames anyway. If you're just trying to get /command /line /switches to work, skip steps 3) and 4), you're done.

3) Do the same thing as for "open", but now use an option (aka: verb) like "run". So create this key:
HKEY_CLASSES_ROOT\Applications\qbasic.exe\shell\Run\command

4) Add this to the "Default" value in the "Run" (or whatever you called it) key:
d:\qbasic\qbasic.exe /h /run %1

Following the same rules as with the "open\command" above. This adds another option ("Run") to the right-click menu for the file.

The above stuff makes my context (aka: shortcut) menu give me both an "Open" and a "Run" choice when I right-click a .BAS file in my win9x system:
right-click -> view 
image

With both the "Open" and "Run" scenarios above, Windows will use the name of the registry key itself, or you can change the default value of the key to something like: RUN IT RIGHT NOW!! ...but it's probably best to leave the actual registry key's name simple - like 'open' or 'run' (without quotes).

HERE IS A .REG FILE TO DO THE WHOLE THING FOR YOU:

REGEDIT4

[HKEY_CLASSES_ROOT\Applications\qbasic.exe]

[HKEY_CLASSES_ROOT\Applications\qbasic.exe\shell]
@="open"

[HKEY_CLASSES_ROOT\Applications\qbasic.exe\shell\open]

[HKEY_CLASSES_ROOT\Applications\qbasic.exe\shell\open\command]
@="d:\\qbasic\\qbasic.exe /h %1"

[HKEY_CLASSES_ROOT\Applications\qbasic.exe\shell\run]
@="Run"

[HKEY_CLASSES_ROOT\Applications\qbasic.exe\shell\run\command]
@="d:\\qbasic\\qbasic.exe /h /run %1"




Written in response to:
"Open With" Command Line Switches (madman420: Friday, September 4, 2009 at 4:00 pm)

Responses to this message:
*re: "Open With" Command Line Switches (madman420: Monday, September 7, 2009 at 9:55 pm)

All messages in this thread [show all]
-"Open With" Command Line Switches (madman420: Fri, Sep 4, 2009, 4:00 pm)
-re: "Open With" Command Line Switches (Keith Stanier: Fri, Sep 4, 2009, 5:16 pm)
-re: "Open With" Command Line Switches (madman420: Sat, Sep 5, 2009, 1:14 am)
-re: "Open With" Command Line Switches (Keith Stanier: Sat, Sep 5, 2009, 3:02 am)
*re: "Open With" Command Line Switches (madman420: Sat, Sep 5, 2009, 3:05 pm)
-re: "Open With" Command Line Switches (madman420: Mon, Sep 7, 2009, 8:31 pm)
*re: "Open With" Command Line Switches (madman420: Mon, Sep 7, 2009, 9:55 pm)
Return to the Windows Me Discussion Forum


All content at Annoyances.org is Copyright © 1995-2009 Creative Elementtm All rights reserved.
Please do not plagiarize; redistributing these pages without permission is strictly prohibited.