Horst Schaeffer's Software Pages
English German

Don't follow leaders
Horst Schaeffer's Software Pages
Wselect 2.30 Selection Window Download 32 bit (39Kb)
Download 64 bit (52Kb)
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 the given file, which can be either fixed, or generated in the batch process. The file may have any number of lines with anything you want to offer. Special options are provided for menus.

User's selection by double click or arrow up/down + Enter. Abort with Escape or by closing the window.
The special menu mode features hand cursor, single click selection and optional header text.

Wselect provides an errorlevel according to the selected item number. Wselect also returns the selected item text embedded in a given text string through the token "$item". This way you can produce messages or commands.

For example, if the given output text string is "SET MyVar=$item", the token $item will be replaced by the selected item. The output can be redirected to a text file or to a batch file for subsequent execution.
Wselect ListFile ListHeader OutputString [MenuHeader] [options] [> OutputFile]
Options include:
- window centered on screen or in console window
- menu mode, font size, font color and background color
- fixed-width font for lists
Wfolder 1.62 Folder Selection Window Download 32 bit (29Kb)
Download 64 bit (41Kb)
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.
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.5 File Selection Window Download 32 bit (13Kb)
Download 64 bit (18Kb)
Wfile includes two programs: FileToOpen.exe for source files, and FileToSave.exe for target files.

The programs offer an "Open file" or "Save as" dialog window, and make the user's selection available in the batch process through a temporary batch file or a FOR /F construct. The program can be used to set an environmental variable or to run a command with the selected file path.
FileToOpen CommandString PathAndFilters [WindowTitle] [options]
FileToSave CommandString PathAndFilters WindowTitle [DefaultName] [options]
PathAndFilters is the initial path with one or more file pattern(s), which must be separated by semicolon,
for example: C:\some\where\*.JPG;*.PNG
The CommandString will be returned with the selected file path appended.

FileToOpen options include /maynotexist (allows to name a new file), and /multiselect.
FileToSave options include /overwritePrompt (to ask the user's permisseeion if file exists).
Example 1: Run Program (Notepad) with selected file
FileToOpen Notepad *.txt "Open Text File" > temp.bat
call temp.bat
Example 2: Set FNAME variable from user's selection
FileToOpen "SET FNAME=" "G:\path\*.jpg;*.gif" "Select Source" > temp.bat
call temp.bat
The programs append the returned file path to the given command, and send it to STDOUT for redirection to a temporary batch file, or for processing in a FOR /F construct.
Selected files are returned with full path enclosed in quote marks (optionally without).
Wbox 1.11 Message Box Download 32 bit (20Kb)
Download 64 bit (27Kb)
Wbox halts a batch process and displays a window with a message text and a number of buttons in order to proceed according to the selected button (number by Errorlevel).
Wbox "Title" "Message" "Buttons" [Options]
The message will be wrapped to several lines if necessary (window size auto-adjusted).
The caret (^) symbol forces a line feed.
The buttons must be separated by semicolons, for example: "Continue;Change source;Quit"

Command options include: message text left aligned or centered, time-out, font size & color, background color, width and height adjustments.
Wprompt 2.3 Standard Message Box Download 32 bit (7Kb)
Download 64 bit (9Kb)
Wprompt stops a batch process, and displays a Windows message box with up to three selectable buttons.
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, and will show in the user's language.
Options: default button (1..3), time-out (seconds) and icon with associated sound (symbols: i ? x !).
Wprompt "Error" "Continue reading files?" YesNo 2 ?
The user's selection (button number 1..) is returned by errorlevel.
Winput 1.42 Input Window Download 32 bit (33Kb)
Download 64 bit (44Kb)
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.
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), colors, font size, x/y window displacment.

Multi line prompt text supported. Automatic window size adjustment.
Wbusy 1.03 Busy Indicator Download 32 bit (28Kb)
Download 64 bit (37Kb)
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.