Announcement

Collapse
No announcement yet.

ComSpec environment value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ComSpec environment value

    My PBDOS program returns C:\WINNT\SYSTEM32\COMMAND.COM for
    the following code.

    UCASE$(ENVIRON$("COMSPEC")

    even thought SET show the environment to be

    ComSpec=C:\WINNT\system32\cmd.exe

    Any idea why?

    ------------------

  • #2
    The CMD.EXE command processor is 32-bit. COMMAND.COM is 16-bit. The
    16-bit command processor is the default for 16-bit applications, such
    as DOS apps, for compatibility reasons. I think there's a registry
    setting you can set to insist otherwise, under Windows 2000, at least.

    Note that DOS environment variables are traditionally all-caps. Many
    DOS programs won't even see a variable such as "ComSpec". The mixed
    case is a hint that it's a Windows environment variable.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment

    Working...
    X