Command Line Parameters

 

A command like this runs a WinBatch system utility from a command line or an icon:

 

WinBatchfilename filename.wbt param1 param2.. param[n]

 

This command line can be entered into a Command Line text entry box like this one from the Windows "START…Run.." menu option.

 

This command line can be entered into a Command Line text entry box like this one:

 

image\01_cmdln_shg.gif

 

The command line is longer than the dialog can show, but it can be easily edited with the arrow keys.

 

WINBATCHFILENAME is the generic name of your WinBatch executable. The specific, or actual, name for the WinBatch application will change to reflect the operating system in use.

 

"filename.wbt" is any valid WBT file, and is a required parameter.

 

"p1 p2 ... p[n]" are optional parameters to be passed to the WBT file on startup. Each is delimited from the next by one space character.

 

In order to pass parameters to a WinBatch script file, you must run the WinBatch executable, itself, and it must be followed by the name of the WinBatch script file and any other desired parameters. WBT files run from the Desktop as shortcuts must have their complete path in the Properties dialog box in order for command line parameters to be received.

 

For example, the command line for "MAIL.WBT", an imaginary WinBatch utility that runs mail with a password passed as a parameter might be:

 

"C:\PROGRAM FILES (X86)\WINBATCH\SYSTEM\WINBATCH.EXE" "D:\TEMP\MAIL.WBT" PASSWORD

 

To edit the shortcut icon properties, highlight the icon, hold down ALT, and press ENTER. The shortcuts properties box should look like the following:

 

Shortcut_Mail.bmp

 

Parameters passed to a WBT file will be automatically inserted into variables named param1, param2, etc. The WinBatch utility will be able to use these. An additional variable, param0, gives you the total number of command-line parameters.

 

A command like this runs the WinBatch+Compiler from a command line or an icon:

 

c:\Program Files (x86)\WinBatch\System\WBCompiler.exe {.wbt}

c:\Program Files (x86)\WinBatch\System\WBCompiler.exe {.cmp}

 

A command like this runs the WinBatch+Compiler  in Batch compile mode from a command line or an icon:

 

c:\Program Files (x86)\WinBatch\System\WBCompiler.exe {.cmplist}

 

For further details see: Batch Compile

 

 

Displaying Passed Parameters in a Message Box

Passing Parameters between Script Files

Writing a Script

Parameters

Menu Files

Ways to run WinBatch Scripts

Batch Compile