330 likes | 371 Views
Learn about DOS commands, file formats, batch files, and command interpreter usage. Master DOS functionalities, including running .EXE and .COM files, working with directories, and navigating the file system efficiently. Understand the importance of spaces in commands and discover essential DOS commands for efficient system operation.
E N D
DOS • Disk operating system
XP, Windows 2000, and Windows NT don't contain DOS. • All three OSs support the cmd.exe command shell, which lets you run NT-equivalent DOS commands. • In XP, click Start, Run, then type cmd.exe.
Dos system • Strictly speaking, no permission mechanism
cmd.exe • Command.com
file redirect pipe Dir | sort |more
There are three types of files you can “run” using DOS. • COM: the oldest of the file formats, small program limited to 64k, everything in one single memory segment. • EXE: allows the program to be larger than 64k, multiple memory segments( data, code and stack) • BAT: batch file. A text file consisting of a series DOS commands.
Batch file • When you run a batch file, DOS reads in each line from the text file and follows the flow control logic expressed by the batch file to execute batch file content properly through a “built-in batch file interpreter”.
command.com • C:\WINDOWS>dir command.* /s/p • Volume in drive C has no label. • Volume Serial Number is 5897-8FA7 • Directory of C:\WINDOWS\SYSTEM32 • 03/19/2004 06:34 PM 50,620 COMMAND.COM • 1 File(s) 50,620 bytes • Total Files Listed: • 1 File(s) 50,620 bytes • 0 Dir(s) 9,717,338,112 bytes free
C:\WINDOWS\SYSTEM32>dir *.com Volume in drive C has no label. Volume Serial Number is 5897-8FA7 Directory of C:\WINDOWS\SYSTEM32 03/19/2004 06:34 PM 7,680 CHCP.COM 03/19/2004 06:34 PM 50,620 COMMAND.COM 03/19/2004 06:35 PM 9,216 DISKCOMP.COM 03/19/2004 06:35 PM 7,168 DISKCOPY.COM 03/19/2004 06:37 PM 69,886 EDIT.COM 03/19/2004 06:37 PM 25,600 FORMAT.COM 03/19/2004 06:37 PM 26,112 GRAFTABL.COM 03/19/2004 06:37 PM 19,694 GRAPHICS.COM 03/19/2004 06:38 PM 14,710 KB16.COM 03/19/2004 06:38 PM 1,131 LOADFIX.COM 03/19/2004 06:39 PM 19,456 MODE.COM 03/19/2004 06:39 PM 15,872 MORE.COM 03/19/2004 06:43 PM 11,264 TREE.COM 03/19/2004 06:44 PM 18,432 WIN.COM 14 File(s) 296,841 bytes 0 Dir(s) 9,717,334,016 bytes free
C:\WINDOWS\SYSTEM32>dir *.exe /p • Volume in drive C has no label. • Volume Serial Number is 5897-8FA7 • Directory of C:\WINDOWS\SYSTEM32 • 11/20/2002 12:50 PM 179,200 ACCWIZ.EXE • 03/19/2004 06:33 PM 4,096 ACTMOVIE.EXE • 02/20/2004 05:13 PM 110,592 AegisI5.exe • 03/19/2004 06:33 PM 91,648 AHUI.EXE • 03/19/2004 06:33 PM 41,984 ALG.EXE • 03/19/2004 06:33 PM 12,498 APPEND.EXE • 03/19/2004 06:33 PM 19,456 ARP.EXE
Batch file • Simply a list of DOS commands, glued together by BASIC language like statements.
FOR • GOTO • IF • REM • ECHO • PAUSE • SHIFT
Variables • Environment variables (global variables)
Space matters in DOS command • Sometimes you have to put space, sometimes, you cannot use space • Nobody can to memorize all the details, but you have access to a computer to try. • Remember, debugging is part of life.
cd my games • Won’t work, because space matters for command line, three arguments now • cd “my games” • It will work
Typing DOS commands on the Windows Command Line prompt is a most efficient and faster way of doing things in Windows XP. Here's a run-down of the most useful DOS commands available in Windows XP. Some of these DOS commands even do not have an visual alternative.
DOS Command-line tools must be run at the prompt of the Cmd.exe command interpreter. To open a DOS window with Command Prompt , click Start, click Run, type cmd, and then click OK. • Or click on Start/All Programs/Accessories/Command Prompt • You can run multiple copies of DOS windows
Use the up/down arrow keys to access previous commands! • History, which is configurable actually
Navigating the directory structure • You can move: • 1. Down the directory structure • 2. Up the directory structure • 3. Across the directory structure • Using GUI based file explore, you need to click, click while the folder visually expand and switch, while using DOS, you need to know the commands!
Find this song • C:\WINDOWS\system32\oobe\images>dir *.wma • Volume in drive C has no label. • Volume Serial Number is 24CA-A6D5 • Directory of C:\WINDOWS\system32\oobe\images • 08/04/2004 08:00 AM 2,624,518 title.wma • 1 File(s) 2,624,518 bytes • 0 Dir(s) 99,089,502,208 bytes free • C:\WINDOWS\system32\oobe\images>
Two modes • Interactive • Batch mode
To open a Windows DOS windows, click on Start/All Programs/Accessories/Command Prompt
Use the up/down arrow keys to access previous commands! • History, which is configurable actually
Navigating the directory structure • You can move: • 1. Down the directory structure • 2. Up the directory structure • 3. Across the directory structure • Using GUI based file explore, you need to click, click while the folder visually expand and switch, while using DOS, you need to know the commands!