Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

COMSPEC

From Wikipedia, the free encyclopedia
Windows environment variable containing the directory path to the command shell

COMSPEC orComSpec is one of theenvironment variables used inDOS,OS/2 andWindows, which normally points to thecommand line interpreter, which is by defaultCOMMAND.COM in DOS,[1] Windows 95, 98, and ME orCMD.EXE in OS/2 andWindows NT. The variable name is written in all-uppercase under DOS and OS/2. Under Windows, which also supports lowercase environment variable names, the variable name is defined asComSpec in the environment block, but asCOMSPEC inside the DOS emulatorNTVDM.When not present in the environment block, the command processor CMD.EXE ofWindows NT setsCOMSPEC to its own fullpath; it evaluatesCOMSPEC for example to execute builtin commands in pipelines, and to execute command lines with its builtinFOR command.[2]

The variable's contents can be displayed by typingSETCOMSPEC orECHO%COMSPEC% at the command prompt.

The environment variable by default points to the fullpath of the command line interpreter. It can also be made by a different company or be a different version.

Another use of this environment variable is on a computer with no hard disk, which needs to boot from a floppy disk, is to configure a ram disk. The COMMAND.COM file is copied to the ram disk during boot and the COMSPEC environment variable is set to the new location on the ram disk. This way the boot disk can be removed without the need to reinsert it after a big application has been stopped. The command line interpreter will be reloaded from the ram disk instead of the boot disk.

References

[edit]
  1. ^PC-DOS 7.0 User Guide (1st ed.).IBM. January 1995. pp. 55, 283, 290.
  2. ^"Idiosyncrasies – Odd, Surprising, Un(der)documented or Weird (Mis)behaviour of Microsoft® Windows® NT".

External links

[edit]
MS-DOS, IBM PC DOS,
compatible systems
Otherx86
Other platforms
Stub icon

ThisMicrosoft Windows article is astub. You can help Wikipedia byexpanding it.

Retrieved from "https://en.wikipedia.org/w/index.php?title=COMSPEC&oldid=1282102872"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp