NT Batch Programming

Cases where DOS6 and Win95 batch code won't work on NT and what to do about it.

Please refer to my main batch page to look for general batch solutions. If you find any code that won't run on NT, let me know and I'll try to post the NT or NT/95 compatible code fixes here. Note that I didn't say I'd find the fix! I'll just post it after you point it out to me.

Get user input from an NT batch file
NT doesn't process devices like CON and NUL consistently. Because most user input schemes rely on CON, we are forced to fall back to QBASIC or Windows Scripting. Luckily, both are standard NT equipment.

Put the date into the environment
NT's different prompts and use of "special characters" spoil the Win95 method. Here are a couple of NT ways to get the date.

Insure QBASIC exists on a Win95 user's machine
Not just test for it, but download and install it automatically too! Just stick this code in front of any batch file that needs QBASIC that may have to run on a Win95 client. This code assumes an internet connection is available... Amazingly, QBASIC is standard on DOS5, DOS6, and NT, but seems to have been skipped on Win95.

Process all lines in a list
Iain Hamilton's suggestion for using the advanced NT options in FOR to simplify list processing.

Joseph Hayes Tips
Pure laziness on my part. When I get cc'ed on an email where Joseph posted an NT tip, I put it here. Let me give you a hint: Learn all you can about the NT "FOR" command.


Lost? Look at the site map.

Bad links? Questions? Send me mail.

Ask Jeeves