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 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. Luckily, QBASIC is standard NT equipment.

Put the date into the environment
NT's different prompts and use of "special characters" spoil the Win95 method. Here is a straightforward NT approach. PC Magazine also published a slightly more complicated (but more versatile?) way.

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.

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.
 



 


Bad links? Questions? Send me mail.