WinBatch Console

 

 

WinBatch Console is a set of programs  you can use to  enter and execute WIL scripting language statements at a command prompt.  WIL statements can be entered and executed singly or as a group by switching WinBatch Console between single and  multiline modes.

WinBatch Console's  8 32-bit and 8 64-bit programs follow the same naming conventions as regular WinBatch with the addition of the letter "C" at the beginning of each name. For example, the console version of "WinBatch.exe" is "CWinBatch.exe."  The console executables have the same manifests for UAC as their regular WinBatch executable counterparts and like their WinBatch counterparts, WinBatch Console programs accept command line arguments including a script file name.

 

You can use WinBatch Console to execute almost any WIL statement from the console's  command prompt:

 

image\CWinBatch_Single.gif

 

Notice that you can use the Cout command  to display the contents of a variable.

 

WinBatch Console also has a multiline mode that you can use to enter multiple WIL statements before they are processed by the interpreter. Placing a colon(:) at the end of a WIL statement changes the console to multiline mode and also changes the prompt to indicate the entry mode switch:

 

image\CWinBatch_Multi.gif

 

The Console also maintains a history buffer that remembers up to the last 50 WIL statements you typed at the prompt or copied from the clipboard. Use the up and down arrow keys to move backwards and forwards in the statement history buffer.  When you press an arrow key, the previous or next statement will display at the prompt.  Execute the statement retrieved form the history buffer by pressing the return key or edit the statement by  moving the insertion point using  left and right arrow keys.

 

The WinBatch Console supports several additional shortcut keys and key combinations for editing, selecting, copying, and pasting WIL statements.

 

Since user-defined function, user-defined subroutines, and variables  from a startup script remain available after the command prompt appears, you can use the startup script to create your own custom commands.   For example, this simple user-defined function placed in a script used as a parameter to CWinBatch.exe mimics some of the functionality of the Unix LS command:

#DefineFunction ls(path)
   ; Default to current directory.
   If path=='' Then tmp=DirGet():'*.*'
   Else tmp=path
   delim=IntControl(29,@lf,0,0,0)
   files=FileItemize(tmp)
   IntControl(29,delim,0,0,0)
   If RtStatus() == 16 Then Cout files
   Else Message(tmp, files)
   Return 1
#EndFunction
                

Running the user-defined function from the command prompt looks something like this:

 

image\CWinBatch_Exam.gif

 

 

 

 

 

 

Cin

Cout

Multiline Mode

Console Keyboard Shortcuts

User Defined Commands

 

UAC Facts

Application Manifests

 

Command Line Parameters