WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Launching WinBatch and Other Apps
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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
File Created: 1999:04:15:16:52:54
Last Updated: 1999:04:15:16:52:54