Every tech worth his or her salt knows the command line interface in Windows, because certain troubleshooting moments require a high comfort level with the command line to achieve success. Here's a list of the top 11 we use on an almost daily basis. Do you have favorites not on the list? Post your comments in the discussion forums (there's a link at the bottom of this Tech File).
11. TYPE
10. RD
9. MD
8. MOVE
7. DEL
6. COPY
5. DELTREE
4. DIR
3. CD
2. PING
1. IPCONFIG
11. TYPE
Type command provides a method to see the contents of a file.
Syntax:
TYPE filename
Example
TYPE TEST.TXT
This will type on the screen the contents of the TEST.TXT file. Remember
Command Line is not a word processor and the data that will be shown may not
be in the most readable format. However the TYPE command is quite handy to
help determine what is contained in a file.
(top of page)
10. RD
RD command provides a method to remove/delete empty directories/folders. The
RD will not remove directories/folders that contain files or subdirectories/subfolders.
Syntax:
RD\[drive:] [directory/folder]
or
RD [drive:] [directory/folder]
Example
RD\Test
Or
RD Test
This will remove the directory/folder called Test, provided the directory/folder
does not contain any files or subdirectories/subfolders.
(top of page)
9. MD
Can't remove a folder or directory without creating one in the first place,
right? MD command provides a method for the user to create or make a new directory/folder.
Syntax:
MD\[directory/folder]
or
MD [directory/folder]
Example:
MD\Test
Or
MD Test
This will create a new directory/folder called Test in the current directory/folder.
(top of page)
8. MOVE
Move command provides a method for the user to move files or directories/folders
from one folder to another or from one drive to another.
Syntax:
MOVE [drive:][path]filename destination
Example:
MOVE A:TEST.TXT C:TEST.TXT
This will move the file test.txt from the A: drive to the C: drive
(top of page)
7. DEL
DEL command provides a method to delete files from the computer. This is a
great one to use for manually deleting virus files.
Syntax:
DEL [drive:] file
Example
DEL A:TEST.TXT
This will delete the file TEST.TXT from the A: drive. If the file is in a
subdirectory/folder, the path must be specified.
(top of page)
6. COPY
Copy command provides a method for the user to copy one or more files to an
alternate location.
Syntax:
COPY [source] [destination]
Example:
COPY A:TEST.TXT C:
This will copy the file test.txt from the A: drive to the C: drive
(top of page)
5. DELTREE
Deltree command provides a method to delete files and directories/folders
from the computer.
Syntax:
DELTREE [drive:] [directory/folder]
Example:
DELTREE A:\TEST
This will delete the TEST directory/folder and all subdirectories/subfolders
and files contained within the A:\TEST directory/folder.
DELTREE will prompt the user to verify if they want to delete all files and subdirectories/subfolders before completing the function.
Using the /Y switch will suppress the command from prompting the user to confirm the delete.
Syntax:
DELTREE A:\TEST /Y
(top of page)
4. DIR
DIR is a DOS command that provides the user with a list of files available
in a directory/folder/folder.
The command can be used simply as DIR to provide a list of files in the current
directory/folder/folder or it can specify what directory/folder/folder of
files to be listed.
Syntax:
DIR [drive:]
DIR [drive:] [path] (this will show files in a specific path.)
Example:
C:\>DIR
Typing DIR at the C: prompt will list the files in the C: directory/folder/folder
There are many switches that can be used with the DIR command to show specific files. A handy switch to know is /p. This switch is useful when there are many files listed in a directory/folder/folder, it will pause the directory/folder/folder list once the screen is full of information and wait for a prompt from the user to continue the list.
Syntax with a switch:
DIR [drive:][path] /p
(top of page)
3. CD
CD command provides a method for the user to change the focus of the command
prompt to a different directory/folder. Without it, we would never get out
of the root directory!
Syntax:
CD\[directory/folder]
or
CD [directory/folder]
Example:
CD\Test
Or
CD Test
This will change the directory/folder in the command prompt to the Test directory/folder.
(top of page)
2. PING
Ping command provides a method to determine if one system is able to contact
another system on a network. It will also let you determine an IP address
and assist in determining in problems in a network.
Syntax:
PING destination
Example:
PING 192.168.4.152
Below is the response of a successful PING command to 192.168.4.152.
PING will also allow you to determine the IP address by typing the domain
of the address.
Example:
PING totalsem.com
Below is the response, note that although totalsem.com was typed, the PING command will use the IP address when trying to send data:
1. IPCONFIG
IPCONFIG is a DOS command that allows the user to view network adapter settings
and assigned values. The command can also be utilized to verify a network
connection.
Syntax:
IPCONFIG
Below is an example of a response from the IPCONFIG command:
IPCONFIG /ALL will displays all the current TCP/IP configuration values, including the IP address, subnet mask, default gateway, and Windows Internet Naming Service (WINS) and DNS configuration.
In most cases, IPCONFIG is only used to perform reporting-type duties, like determining your IP address or DNS server name. However it can be helpful when using DHCP. If you’re unable to connect to the Internet, try using the /renew switch to renew the DHCP lease. If you get a DHCP server not available error, try the /release switch and then the /renew switch. If the error persists, you may have a problem with the DHCP server.
Switch Syntax:
IPCONFIG /ALL
IPCONFIG /RELEASE
IPCONFIG /RENEW
Example of IPCONFIG /ALL
