[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

Top Document: comp.os.msdos.programmer FAQ part 4/5
Previous Document: - What's this 'null pointer assignment' after my C program executes?
Next Document: - How can my program tell if it's running under Windows?


- How can a batch file tell whether it's being run in a DOS box under Windows?


Date: 5 Feb 2002 22:03:03 -0400

 When Windows 3.0 or 3.1 is running, the DOS environment will contain a
 definition of the string windir, in lower case. That's not really
 useful, however, because the batch statement

  if "%windir%" == "" ...

 will test for an environment variable WINDIR in upper case.

 Your only real option is to write a program as suggested by the
 following question, and have it return a value which your batch file can
 test via "if errorlevel".



Top Document: comp.os.msdos.programmer FAQ part 4/5
Previous Document: - What's this 'null pointer assignment' after my C program executes?
Next Document: - How can my program tell if it's running under Windows?

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
jeffrey@carlyle.org (Jeffrey Carlyle)

Last Update October 22 2009 @ 05:28 AM

Some parts © 2009 Advameg, Inc.