Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CMD.EXE Scripting Tutorial 1

Status
Not open for further replies.

webrabbit

MIS
Jan 31, 2003
1,059
0
0
US
Does anyone know where a tutorial on batch scripting for CMD.EXE might be. I am very familiar with batch scripting for COMMAND.COM, but I understand that CMD.EXE is much more advanced, as well as not having a couple of bugs in COMMAND.COM that I have either exploited or found work-arounds.
 
I am not much of a "scripter" but I would have thought that the batch commands would be the same in either situation?


This article is a few years old but might be worth a read.


John Savill's FAQ for Windows



"Windows NT/Windows 2000 supply cmd.exe and command.com. CMD.EXE is the Windows NT command line interface, its NOT a DOS window. COMMAND.COM is a 16-bit DOS application which is used for older DOS compatibility and actually runs inside the NTVDM (NT Virtual DOS Machine) due to its 16-bit nature.

What may surprise you is the face that COMMAND.COM and CMD.EXE have almost identical features and this is because any command entered in COMMAND.COM it is packaged up and sent to CMD.EXE for execution and thanks to this COMMAND.COM can take advantage of all the functions and facilities of CMD.EXE. This is possible as the version of COMMAND.COM shipped with NT IS a special NT version designed to pass all execution to CMD.EXE.

If you had Task Manager running you would actually see a CMD.EXE process started when executing commands in COMMAND.COM."


See the comments at the end of the article which mention the CD command, and mention NTVDM.
 
OK, so the current version of COMMAND.COM calls CMD.EXE. That does not answer my question. As I mentioned, I am very familiar with the old version of COMMAND.COM, including certain bugs. In fact, I was once hired soly on my DOS batch knowledge.

But there appear to be many advances in CMD.EXE (albeit shared by COMMAND.COM as you say) which I am not familiar with. One in particular is the new IF structure, which I have seen as being bi-level instead of true only. I would like to find a complete listing of the scripting language suppoted by CMD.EXE including syntax and switches.

The referance you gave seems to be all about Power Shell, of which I know nothing and have no interest.
 
start
help and support
pick a task
use tools to view your computer information and diagnose problems
tools
command shell overview
using batch files
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top