Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Launch WinBatch with Parameters from a File

Keywords:   param0 parameters  

Question:

How could I do this with a compiled script? I want to be able to "run" a data file, and have the associated program determine the file to be loaded. This should work like double-clicking .doc and getting Word to load the file.

For example: a user double-clicks "myapp.xxx" which loads and runs myapp.exe (a compiled winbatch script). I need the compiled script to be able to retrieve the value "myapp.xxx".

If I could determine the window that contained "myapp.exe", perhaps I could retreive it that way...

Answer:

The myapp.exe should be in the:
param1
variable. (Read about this in the Winbatch.HLP file on in your small WinBatch User's guide.)

If all goes wrong, and it parses the filename into separate variables (because the default registry entry does not have quotes around the file name, you have to have...

if param==0
Message("Ooops","no parameters specified")
endif

cmdline=param1
for x=2 to param0
cmdline=strcat(cmdline," ",param%x%)
next
Message("Command Line is",cmdline) 

Article ID:   W13272
Filename:   Launch WinBatch with Parameters from a File.txt