Wizard's Apprentice

Main

Manual

Download



SourceForge.net Logo


*  The Wizard's Apprentice  *

Making batch files interactive

*Introduction

Batch files still are a good way to get things done. As long as the things are simple, a batch file can be exactly the right way to do it: easily written, portable, and no need to install anything to get it to work. There is one big shortcoming of batchfiles though: interactivety. There is hardly a nice way to ask the user questions. In the old days, in MSDOS, there was no way at all to ask questions; then came CHOICE, a very primitive utility to ask Yes/No kind of questions and get an error level back. And that was it.

Now there is the Wizard's Apprentice. It will allow you to ask questions from a batch file, using Windows dialog boxes in the so-called Wizard style: large dialogs asking one question at a time, with a Back button, a Next button and a Cancel button.

-What does it look like?

Here is a screenshot of the Wizard's Apprentice showing a welcome text.

Screenshot of Welcome dialog

Here is another screenshot from the same program, asking to choose a language from a list.

Screenshot of language
    selection dialog

Here's a message box, that allows you to ask Yes/No questions:

Screenshot of messagebox

-Features

  • When you run the Wizard's Apprentice, it will display a dialog on the screen. The Wizard's Apprentice can display the following types of dialogs.
    Message box
    A Message box with the information, exclamation or stop icon, or with the question icon and an OK and a Cancel button.
    Text screen
    A wizard-style dialog displaying only text, e.g. a welcome screen.
    File contents
    A wizard-style dialog with a box with a scroll bar on it, in which a file is displayed. Can be used to display a license text.
    Edit field
    A wizard-style dialog with an edit field on it, where the user can type text.
    Radio buttons
    A wizard-style dialog with a set of radio buttons on it.
    Checkboxes
    A wizard-style dialog with a set of check boxes on it.
    Listbox
    A wizard-style dialog with a listbox on it. This listbox is either a single-selection box, where you can select exactly one item, or a multiple-selection listbox, from which you can select zero or more items.
    Combo box
    A wizard-style dialog with a combo box on it. A combo box allows you to select an item from a list, or type it yourself.
    File- or directory browser
    A wizard-style dialog with an edit field on it with a Browse button next to it. Pressing the Browse button will either show an open file dialog, or a directory tree dialog.
  • The Wizard's Apprentice will return an errorlevel that indicates which button the user pressed.
  • The appearance of the wizard-style dialog can be completely controlled:
    • Set the title of the dialog
    • Set the text contents of the dialog
    • Set the sidebar picture of the dialog
    • Set the labels of the buttons
    • Set the icon of the dialog
    • Set the signature text on the bottom-left corner of the dialog
  • The choice that the user made, or the text that was typed, is returned in environment variables.

Dion Nicolaas
dionnicolaas@users.sourceforge.net

The Wizard's Apprentice's Home
http://wizapp.sf.net