Help Screen

Issue: May 1996
Section: Win95
Pages: 202


Contents

Windows 95 Adviser
Run your programs in a batch


Windows 95 Adviser

Run your programs in a batch

After replacing some ancient 286s in my office with Windows-capable PCs earlier this year, I discovered one great thing about the old clunkers: they all booted to a menu. It turns out that some of my users just couldn't cope with the Windows Program Manager or even, once we upgraded, the Windows 95 Start menu. I've concluded that for some people, there's no better interface than a simple "Press 1 for Peachtree, Press 2 for Word".

I wasn't able to write such a menu in Windows 3.1 or Windows 95, since neither one of them has a scripting language. But then I had a revelation: I could write a menu in the DOS batch language. This sounds Neanderthal, but it works because Windows 95, unlike Windows 3.x, can run Windows programs from the command line or from a batch file. And while DOS menus aren't particularly pretty, they are kind of chic in a retro way.

Simple menus are easy to write in the DOS batch language, and the batch file shown here gives one example. When you're creating this file, make sure you establish the correct path to choice.com and to the applications themselves. To generate special characters like the borders in this DOS menu, use Win 95's DOS Edit, not Notepad or Wordpad. To generate, say, the top border (composed of ASCII character 223), hold down the <Alt> key while you type 223 on the numeric keypad, then release <Alt>.

If you're rusty on the ASCII character set or on DOS editing in general, see Qbasic's on-screen help. If you deleted Qbasic, you can reinstall it from the Windows 95 CD-ROM. It's in the \other\oldmsdos directory, along with other DOS golden oldies. Don't forget to copy over qbasic.hlp as well. After running Qbasic, press <Enter> to see the Survival Guide, then select Using Help-Contents-ASCII Character Codes.

Note that although you can launch a Windows program simply by typing its name, as with Calculator, you can also launch one using a new command called Start, as with Notepad. The option "/max" in the sample batch file starts a program maximised.

To see all the Start options, type Start /? at the command line.

When your batch file is done, move it into \windows\start menu\programs. Then, to start making a shortcut for it, right-click it and select Properties. This brings up a properties sheet that's specific to DOS applications and that replaces the PIF editor.Then make these changes in the properties sheet:

* On the Program tab, the first line (next to the icon) lists the name that will appear both in the title bar of the menu window and on the taskbar button. Make this name short and clear, like Menu.

* Also on the Program tab, make sure Close on exit is not checked. You don't want the final instructions in the menu window to disappear when the user chooses to shut down.

* On the Font tab, make the font large and easy to read.

* On the Screen tab, uncheck Display toolbar so the user doesn't see it.

* Finally, move the shortcut to the startup folder (\windows\start menu\programs\startup) so that it runs each time Windows 95 boots.

On running the menu for the first time, you can size and position the window to your liking, and these settings will stick. And if you have a few users like mine, I'm sure your menu will be to their liking as well.

By Richard Freedman

@echo off

:top

cls

echo.

echo

echo PRESS A NUMBER TO RUN A PROGRAM

echo

echo 1. Notepad

echo 2. Calculator

echo 3. Shut down the computer

echo

echo

choice /c:123 /n " Please enter 1, 2 or 3 "

if errorlevel 3 goto Exit

if errorlevel 2 goto Calculator

if errorlevel 1 goto Notepad

:Notepad

start /max Notepad

goto Top

:Calculator

Calc

goto Top

:Exit

cls

echo.

echo Before turning off your PC...

echo.

echo Press Ctrl+Esc, then U, then Enter.

echo Then wait until told to shut off your PC.


These Web pages are produced by Australian PC World © 1996 IDG Communications