Detecting JP Software shells


Staff member
May 16, 2008
Migrated From JP Software Wiki

A batch file can test whether it is running in a JP Software shell by attempting a numeric comparison:

if 01 == 1.0 echo Running in 4DOS, 4NT or Take Command!

This syntax is legal in COMMAND.COM and all compatible shells, including 4DOS, 4NT, Take Command, and CMD.EXE. In JP Software shells, this is a numeric comparison and true; in COMMAND.COM and CMD.EXE, it is a string comparison and false.

Once you have established that the batch file is running in a JP Software shell, internal variables like _CMDPROC, _4VER, _DOS, _DOSVER, _WIN, and _WINVER may be used to further determine the operating environment.