ตัวแปร ของ COMMAND.COM

ไฟล์ชุดคำสั่งสำหรับ COMMAND.COM มีตัวแปรสี่ชนิดดังต่อไปนี้:

  • Environment variables: These have the %VARIABLE% form and are associated with values with the SET statement. Before DOS 3 COMMAND.COM will only expand environment variables in batch mode; that is, not interactively at the command prompt.[ต้องการอ้างอิง]
  • Replacement parameters: These have the form %0, %1...%9, and initially contain the command name and the first nine command line parameters passed to the script (e.g., if the invoking command was "myscript.bat John Doe", then %0 is "myscript.bat", %1 is "John" and %2 is "Doe"). The parameters to the right of the ninth can be mapped into range by using the SHIFT statement.
  • Loop variables: Used in loops, they have the %%a format when run in batch files. These variables are defined solely within a specific FOR statement, and iterate over a certain set of values defined in that FOR statement.
  • Under Novell DOS 7, OpenDOS 7.01, DR-DOS 7.02 and higher, COMMAND.COM also supports a number of system information variables,[2][7][1] a feature earlier found in 4DOS 3.00 and higher[8] as well as in Multiuser DOS,[1] although most of the supported variable names differ.

แหล่งที่มา

WikiPedia: COMMAND.COM http://www.allenware.com/mcsw/errorlevels.zip http://command.com/ http://www.antonis.de/dos/batchtut/battips/index.h... http://www.antonis.de/dos/dos-tuts/mpdostip/html/m... http://www.antonis.de/dos/dos-tuts/mpdostip/html/n... http://www.drdos.net/documentation/usergeng/07ugch... http://www.drdos.net/documentation/usergeng/uglont... http://www.freedos.org/technotes/technote/207.html https://www.auersoft.eu/soft/by-others/dos-exitcod... https://www.auersoft.eu/soft/by-others/dos-exitcod...