0% found this document useful (0 votes)
71 views2 pages

DOS Commands Syntax Example Meaning

The document provides a comprehensive list of DOS commands categorized into file and directory management, system and disk management, system information and configuration, user and system control, batch file and advanced commands, and networking commands. Each command includes its syntax, an example, and a brief explanation of its function. This serves as a quick reference guide for users to effectively utilize DOS commands.

Uploaded by

98261safiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views2 pages

DOS Commands Syntax Example Meaning

The document provides a comprehensive list of DOS commands categorized into file and directory management, system and disk management, system information and configuration, user and system control, batch file and advanced commands, and networking commands. Each command includes its syntax, an example, and a brief explanation of its function. This serves as a quick reference guide for users to effectively utilize DOS commands.

Uploaded by

98261safiq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DOS Command List with Syntax, Example, and

Meaning

■ File and Directory Management Commands


Command Syntax Example Meaning

DIR DIR [drive:][path][filename] DIR C:\Documents Displays list of files and folders.

CD CD [directory] CD Music Changes current directory.

MD / MKDIR MD [directory name] MD Projects Creates new directory.

RD / RMDIR RD [directory name] RD OldFiles Deletes empty directory.

DEL DEL [filename] DEL data.txt Deletes files.

COPY COPY [source] [destination] COPY file.txt D:\Backup Copies files.

XCOPY XCOPY [source] [destination] [/S /E] XCOPY C:\Data D:\Backup /S /E Copies directories including subfolders.

MOVE MOVE [source] [destination] MOVE notes.docx D:\Notes Moves files or directories.

REN / RENAME REN [oldname] [newname] REN old.txt new.txt Renames file or folder.

■ System and Disk Management


Command Syntax Example Meaning

CLS CLS CLS Clears screen.

VER VER VER Displays DOS version.

DATE DATE [mm-dd-yyyy] DATE Shows or changes date.

TIME TIME [HH:MM:SS] TIME Shows or changes time.

VOL VOL [drive:] VOL C: Displays volume label and serial number.

LABEL LABEL [drive:] [label] LABEL BACKUP Creates or changes disk label.

CHKDSK CHKDSK [drive:] CHKDSK C: Checks disk for errors.

FORMAT FORMAT [drive:] FORMAT D: Formats disk (erases data).

DISKCOPY DISKCOPY [drive1:] [drive2:] DISKCOPY A: B: Copies contents of one disk to another.

■ System Information and Configuration


Command Syntax Example Meaning

MEM MEM MEM /C Displays memory usage.

PROMPT PROMPT [text] PROMPT $P$G Changes prompt appearance.

PATH PATH [directories] PATH C:\Windows;C:\Tools Sets executable file search paths.

SET SET [variable=value] SET TEMP=C:\TEMP Sets or shows environment variables.

ECHO ECHO [message] ECHO Hello World Displays messages or toggles echo.

MODE MODE [device] [options] MODE COM1:9600,N,8,1 Configures system devices.


■ User and System Control
Command Syntax Example Meaning

EXIT EXIT EXIT Closes command prompt.

PAUSE PAUSE PAUSE Suspends batch execution until key press.

SHUTDOWN SHUTDOWN [/S /R /T time] SHUTDOWN /S /T 0 Shuts down or restarts computer.

TASKLIST TASKLIST TASKLIST Lists running processes.

TASKKILL TASKKILL /IM [processname] /F TASKKILL /IM notepad.exe /F Ends a process.

■ Batch File & Advanced Commands


Command Syntax Example Meaning

CALL CALL [filename] CALL backup.bat Calls another batch file.

IF IF [condition] command IF EXIST test.txt ECHO Found Executes command if condition true.

FOR FOR %variable IN (set) DO command FOR %f IN (*.txt) DO TYPE %f Repeats a command for each file.

GOTO GOTO [label] GOTO End Moves execution to label.

REM REM [comment] REM Backup starts Adds comments in batch files.

■ Networking Commands
Command Syntax Example Meaning

PING PING [hostname/IP] PING google.com Tests network connection.

IPCONFIG IPCONFIG [/ALL] IPCONFIG /ALL Displays network configuration.

NETSTAT NETSTAT [-a] NETSTAT -A Shows connections and ports.

TRACERT TRACERT [hostname] TRACERT google.com Traces route to destination.

NET NET [command] NET VIEW Manages network resources.

You might also like