1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Detecting JP Software shells

Discussion in 'T&T - Scripting' started by nchernoff, Jun 4, 2008.

  1. nchernoff

    nchernoff Administrator
    Staff Member

    Joined:
    May 16, 2008
    Messages:
    42
    Likes Received:
    2
    Migrated From JP Software Wiki

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

    Code:
    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.
     

Share This Page