Using DOS Commands on Windows XP

Using DOS Commands on Windows XP

Many of the tasks on Windows XP or for that matter any other Windows operating system can be performed much efficiently using DOS commands on the command prompt. There are some DOS commands that do not even have a GUI alternative.

Let's take a look at some important DOS commands available in Windows XP. These commands/tools must be run from the command prompt of the cmd.exe command interpreter.

To run cmd.exe, click Start, click Run, type cmd and click OK. You will then see a black window similar to the one above.

Tip: Wherever you have to type the path to a folder after the command, just drag the file or folder from Windows Explorer into the command window instead of typing the whole path.

Assoc: Displays or modifies file name extension associations. Used without parameters, assoc displays a list of all the current file name extension associations.

At: Schedules commands and programs to run on a computer at a specified time and date. You can use at only when the Schedule service is running. Used without parameters, at lists scheduled commands.

Attrib: Displays, sets, or removes the read-only, archive, system, and hidden attributes assigned to files or directories. Used without parameters, attrib displays attributes of all files in the current directory.

Comp: Compares the contents of two files or sets of files byte by byte. Comp can compare files on the same drive or on different drives, and in the same directory or in different directories. When comp compares the files, it displays their locations and file names. Used without parameters, comp prompts you to enter the files to compare.

Copy: Copies one or more files from one location to another.

Cprofile: Cleans specified profiles of wasted space and, if user-specific file associations are disabled, removes these associations from the registry. Profiles that are currently in use are not modified.

Defrag: Locates and consolidates fragmented boot files, data files, and folders on local volumes.

Driverquery: Displays a list of all installed device drivers and their properties.

Fc: Compares two files and displays the differences between them. Fc can even resynchronize files if there is a mismatch.

Find: Searches for a specific string of text in a file or files. After searching the specified file or files, find displays any lines of text that contain the specified string.

Getmac: Returns the media access control (MAC) address and list of network protocols associated with each address for all network cards in each computer, either locally or across a network.

Help: Provides online information about system commands (that is, non-network commands). Used without parameters, help lists and briefly describes every system command.

Helpctr: Starts Help and Support Center. Used without parameters, helpctr displays the Help and Support Center home page.

Hostname: Displays the host name portion of the full computer name of the computer.

Ipconfig: Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Used without parameters, ipconfig displays the IP address, subnet mask, and default gateway for all adapters.

Irftp: Sends files over an infrared link. Used without parameters or used with /s, irftp opens the Wireless Link dialog box, where you can select the files that you want to send without using the command line.

Lpq: Displays the status of a print queue on a computer running Line Printer Daemon (LPD). Used without parameters, lpq displays command-line help for the lpq command.

Mmc: Opens Microsoft Management Console (MMC). Using the mmc command-line options, you can open a specific MMC console, open MMC in author mode, or specify that the 32-bit or 64-bit version of MMC is opened.

More: Generally used along with other commands, displays one screen of output at a time.

Move: More convenient than copy-paste. Moves one or more files from one directory to the specified directory. For example, you have some Excel files having their names start with "MonthlyReport" in your My Documents folder which you want to move to a separate folder. Using the Windows XP Explorer, you would have to manually select every single file and then use cut-paste. Using the move command to perform the same task is much simpler and easier. Type the following command and hit enter:
move MonthlyReport*.xls c:\MonthlyReports\

Msinfo32: Displays a comprehensive view of your hardware, system components, and software environment.

Netstat: This command is very useful to diagnose slow internet connections. It displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections.

Openfiles: Queries or displays open files. Also queries, displays, or disconnects files opened by network users.

Ping: Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) Echo Request messages. The receipt of corresponding Echo Reply messages are displayed, along with round-trip times. Ping is the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution. Used without parameters, ping displays help.

Recover: Recovers readable information from a bad or defective disk.

Runas: Allows a user to run specific tools and programs with different permissions than the user's current logon provides.

Shutdown: Allows you to shut down or restart a local or remote computer. Used without parameters, shutdown will logoff the current user.

Start: Starts a separate Command Prompt window to run a specified program or command. Used without parameters, start opens a second command prompt window.

Systeminfo: Displays detailed configuration information about a computer and its operating system, including operating system configuration, security information, product ID, and hardware properties, such as RAM, disk space, and network cards.

Taskkill: Ends one or more tasks or processes. Processes can be killed by process ID or image name.

Tasklist: Displays a list of applications and services with their Process ID (PID) for all tasks running on either a local or a remote computer.

Tree: Graphically displays the directory structure of a path or of the disk in a drive.

Ver: Displays the Windows XP version number.

Vol: Displays the disk volume label and serial number, if they exist. A serial number is displayed for a disk formatted with MS-DOS version 4.0 or later.

W32tm: A tool used to diagnose problems occurring with Windows Time.

Xcopy: Copies files and directories, including subdirectories.

You can find the complete list of command prompt commands for Windows XP, Syntax, Parameters & Examples here.