Horst Schaeffer's Console Mode Tools
Wselect 1.31 Selection Window Download (17Kb)
Wselect offers a window with a list of items for selection in a batch (BAT/CMD) process. The items are read (line by line) from a file that can be generated in the batch process. The file may have any number of lines with anything you want to offer.

User's selection by double click or Cursor up/down + Enter. Abort with Escape or by closing the window.

Wselect returns the selected item text embedded in a given text string through the token "$item" (not case sensitive). This way you can produce messages or commands.

For example, if the given text string is "SET MyVar=$item", the token $item will be replaced by the selected item. Wselect also returns the selected item number by errorlevel (1..254).

The output can be redirected to a text file or to a batch file for subsequent execution.

Syntax:
Wselect ListFile ListHeader OutputString [options] [> OutputFile]
Options to handle OEM (DOS) code and quote marks.
 
Wfolder 1.6 Folder Selection Window Download (24Kb)
Wfolder opens a window with a directory tree, and makes the user's selection available in the batch process through a temporary batch file.

The program can be used to set an environmental variable or to change the current directory.
Syntax:
Wfolder Command initialDir [WindowTitle] [/noquote] [/backslash]
Example 1: Change directory as selected by user
 
Wfolder CD \\ "Change Directory" > temp.bat
call temp.bat
Example 2: Set TargetDir variable from user's selection
 
Wfolder "SET TargetDir=" . "Select Folder" /noquote > temp.bat
call temp.bat
Wfolder sends a command line to STDOUT, which can be redirected to a temporary batch file, or processed with a FOR /F construct.
For the CD command an extra line is generated to change the drive if necessary. Commands other than CD or SET are also supported.

The file fcd.cmd is included to change directory at the command prompt.
 
Wfile 1.3 File Selection Window Download (7Kb)
Wfile offers an "Open File" dialog window, and makes the user's selection available in the batch process through a temporary batch file.

The program can be used to set an environmental variable or to run a command with the selected file.
Syntax:
Wfile Command PathAndFilters [WindowTitle] [/noquote] [/maynotexist] [/multiselect]
PathAndFilters is the initial path and one or more file pattern(s), which must be separated by semicolon,
for example: C:\some\where\*.JPG;*.PNG

Option [/maynotexist] allows the user to enter a new file name.
Option [/multiselect] returns a space separated sequence of the selected files (each with full path).
Example 1: Run Program (Notepad) with selected file
 
Wfile Notepad *.txt "Open Text File" > temp.bat
call temp.bat
Example 2: Set FNAME variable from user's selection
 
Wfile "SET FNAME=" "G:\path\*.jpg;*.gif" "Select File" > temp.bat
call temp.bat
Wfile sends a command line to STDOUT, which can be redirected to a temporary batch file, or processed with a FOR /F construct.
Selected file names are returned with full path enclosed in quote marks (optionally without).
 
Wprompt 2.2 Standard Message Boxes Download (6Kb)
Wprompt stops a batch process, and displays a Windows message box with up to three selectable buttons.
Syntax:
Wprompt "Title" "Text" Buttons Default:TimeOut Icon
Title and message text are expected in double quote marks.
Buttons are specified by the keywords Ok, OkCancel, YesNo, YesNoCancel.
Optional default button by number, time-out (seconds) and icon with associated sound (symbols: i ? x !).
Example:
Wprompt "Error" "Continue reading files?" YesNo 2 ?
The user's selection (button number 1..) is returned by errorlevel.

Note: Wprompt will also work with a minimized console window (Win 2000 or better required).
 
Winput 1.21 Input Window Download (14Kb)
Winput offers a user input window for batch processing. The input string will be inserted into a user defined output string, which can be redirected to a file. For example, you can send a command to a batch file this way, and then run it.
Example:
Winput "SET Name=$input" "Please enter your name" > temp.bat
if not errorlevel 1 call temp.bat
Command arguments: Output string (with $input token), prompt text, optional initial string;
Options for upper/lower case, numeric input, password, timeout (seconds), OEM output (DOS characters)

Multi line prompt text supported. Automatic window size adjustment.
 
Wbusy 1.0 Busy Indicator Download (13Kb)
Wbusy is a busy indicator for time consuming batch processes. The busy window displays a count or a marquee style indicator with a text message.
To close the window, or to replace it with a "done" message, the program is run again with the /stop parameter.
Example to start:
START Wbusy "Backup" "Copying files..." /marquee
The START command is required to continue the batch.
Example to stop:
Wbusy "Backup" "Files copied; Errorlevel: %errorlevel%" /stop /sound
In /stop mode the message text is displayed with an OK button (optional timeout).
If no text is given, the busy indicator just vanishes.
In both cases the same title must be used.

Multi line text messages supported. Automatic window size adjustment.
» 32 Bit Batch Tools for unattended mode »