LeeTutor's Doing Windows

Home Page

Doing Windows

Windows Tips Categories

Shortcuts Tips

PASSING PARAMETERS TO A PROGRAM

Suppose you have a DOS program you use, normally in a DOS session where you type in the name of the program followed by a parameter that specifies some sort of input. For example, I have a little freeware utility called BROWSE that can be used to display a page at a time of an ASCII text file to the screen, and where you use the <PgUp> and <PgDn> keys or the Up and Down arrows to maneuver around the file; and you close the program by hitting the <Esc> key. If I wanted to run BROWSE.COM on a text file called READ.ME, for instance, I would type in the DOS command "BROWSE READ.ME" while at the command prompt.

Browse shortcut


How would this sort of thing be done within Windows without going into a DOS session? Well, after you get into Explorer and create a shortcut for the BROWSE.COM program, if you click on it, in this particular case the program doesn't run, because it expects you to have already specified an input file. In order to accomplish that, you right-click on the shortcut to access the context menu, click on Properties, then click on the Program tab, click on the line "Cmd-line" which specifies the full path to your program ("C:\UTIL\BROWSE.COM" in my case), and add a space followed by a question mark (?) to the end of that line. The question mark specifies that the program expects a run-time parameter. So now when you click on the shortcut for Browse, you first get a dialog box where you can type in the name of the file you want to browse, and then the program runs properly.