PRACTICAL NO.
WINDOWS COMMAND – 1
Aim: Execute following Windows (DOS) Commands – date, time, md, cd, rd, path, set path, chkdsk,
copy,
move, del, dir, cls, prompt.
Commands:
1. date
Syntax: >date
Working: ‘date’ command is used to display and change date. If you don’t want to change date just
press
enter to come out. If you want to change date, insert new date in dd-mm-yy format and press enter.
Command and Output:
2. time
Syntax: >time
Working: : ‘time’ command is used to display and change time. If you don’t want to change time just
press
enter to come out. If you want to change time, insert new time in Hours:Mins:Sec.Nano Sec format
and
press enter.
Command and Output:
3. md
Syntax: md Dir_Name
Working: ‘md’ command is used to make/create a directory.
Command and Output:
PRACTICAL NO.2
4. cd
Syntax: >cd dir_name
Working: ‘cd’ command is used to change the current working directory.
Command and Output:
5. rd
Syntax:> rd dir_name
Working: ‘rd’ command is used to remove/delete a directory. Note this command should not be
used to
delete file. In e.g. below after we remove directory B1, We cannot make it current working directory
as B1
has been deleted and no longer exists.
Command and output:
6. chkdsk
Syntax and Command: D:\>chkdsk
Working: chkdsk—Check Disk. This command is used to verify the file systems integrity and list any
errors
with file system.
Short output:
PRACTICAL NO.2
7. copy
Syntax: copy source_file Destination_location
Working: This command copies the file given in ‘source_file’ to destination location. If destination
location
is not given file is copied to current working directory.
Command and Output:
PRACTICAL NO.2
8. move
Syntax: move source_file Destination_location
Working: This command moves the file given in ‘source_file’ to destination location. If destination
location
is not given file is moved to current working directory. Works as cut paste.
Command and Output:
9.del
Syntax: del file_name
Working: ‘del’ command is used to delete a particular file. Note this command is used to delete file
and not
directories, For deleting directories use command ‘rd’
Command and Output:
10. dir
Syntax: dir or dir directory_name
Working: List the contents of directory_name or list the contents of current working directory if
directory_name is not specified.
Command and Output:
PRACTICAL NO.2
11. path
Syntax: path
Working: This command is used to display or change the list of folders stored in the %PATH%
environment variable.
Command and Output:
12. set path
Syntax: set path= “path”
Working: Set a new path in environment variable ‘path’ for a particular file.
Command and Output:
13. cls
Syntax: cls
PRACTICAL NO.2
Working: ‘cls’ command is used to clear the screen.
Command and Output:
14. prompt
Syntax: prompt Symbol
Working: This command changes the prompt. Special symbols defined are: $$ for $ prompt, $l for <
prompt, $g for > prompt, $p for path prompt. Combinations of these symbols can also be used for
e.g. $p$g
for path> prompt. Here path is nothing but path of current working directory.
Command and Output: