COMSPEC

COMSPEC or ComSpec is one of the environment variables used in DOS, OS/2 and Windows, which normally points to the command-line interpreter, which is by default COMMAND.COM in DOS,[1] Windows 95, 98, and ME or CMD.EXE in OS/2 and Windows 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 as ComSpec in the environment block, but as COMSPEC inside the DOS emulator NTVDM.

When not present in the environment block, the command processor CMD.EXE of Windows NT sets COMSPEC to its own full path; it evaluates COMSPEC, for example, to execute builtin commands in pipelines and to execute command lines with its builtin FOR command.[2]

The variable's contents can be displayed by typing SET COMSPEC or ECHO %COMSPEC% at the command prompt.

The environment variable by default points to the full path 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

  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".

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.