[Tips]

Supplying A Command Line Argument from System Manager

There are a lot of great DOS programs out there that require a command line argument to really be useful, but it's a pain to open up a DOS shell and run them by hand. What you really need is a way to put an icon in System Manager and be able to have the program execution pause so you can enter that argument. For example:

dir *.bat

This batch file method is from an old PC Magazine article...

@echo off
  rem INPUT.BAT
  rem  echo This will copy your input to the environment variable INPUT_
  echo Give your input:
  fc con nul /lb1 /n | time | find "    1:  "> setinput.bat
  echo @echo off> enter.bat
  echo set input_=%%4>> enter.bat
  call setinput
  del setinput.bat
  del enter.bat
  echo Your input is in the environment variable %%input_%%

There's only one problem with this approach on the HP palmtops; they don't come with a complete version of MS-DOS. You need the programs fc.exe and find.exe. The reason I make them available here is: You own a copy of MS-DOS by owning the palmtop, therefore you should be entitled to all the programs that make up MS-DOS 5.00.

OK, now you ask, "What do I do with this batch file and what does it do exactly?" What the batch file does is compare the ascii files "con" (the console) and "nul" (nothing), pipe their output to a couple of programs to pick up some necessary wordage and then uses some redirection trickery to set an environment variable equal to your input. To use your input, all you have to do in the same batch file is put:

program_name %input_%

Now you can assign this batch file to a System Manager icon and hot key to have instant access to the command at all times.



My e-mail address:

mitch@hp200lx.net

  • Any questions, comments or so- please send me an e-mail!
    [Tips]