Using DOS Commands with Windows XP Home, XP Professional and Vista

Get the Most Out of Microsoft Windows by Using Powerful DOS Commands and Know Which Ones Work on Which Systems

James W.
Only a certain percentage of the people who work on computers today with Microsoft Windows seem to know how to use DOS commands. Some may feel that they've given way to the brevity of Graphical User Interfaces used by Mac OS X and Windows, but the command line is still very important, and very much alive and well. There are times that people are asked to type things out on a RUN box and use DOS commands in Windows, and they do so often without realizing it. On this article, advanced and intermediate users will find that I've tested and isolated the DOS commands that will work on one version of XP but not another. Anyone who is new to DOS in Windows will be given a brief introduction, and shown a few Windows hot keys that will make the use of the DOS box easier and more manageable for those who are used to a graphical system only.

If you are an advanced user or intermediate user, then please feel free to skip over the introduction below and go straight to the command reference section. Otherwise, for newcomers it will be helpful for you to read these next few paragraphs before getting started.

For today's users, I would imagine that a cryptic text prompt without any sound, graphics or mouse controls upon a screen of darkness may be a bit intimidating! But don't worry, because once you get the hang of it...you will start to see the freedoms, benefits and many advantages of using things from the command prompt to save time and gain efficiency as opposed to pointing and clicking everything. Remember, once upon a time...all levels of computer users had to use a command prompt full screen as the only way to talk to the computer, and even that was an advancement over far more cryptic methods of using things like magnetic punch tape, and numeric keypads where all commands were given as numbers and you had to memorize those to work with it!

We have come a long way. Sometimes I feel, not necessarily in the right direction ... but the fact is that progress has been made regardless of the direction is still entirely true.

Microsoft Windows never really got rid of DOS completely (after all, it was based on it). Sure, they use things like NTLDR now and the NTFS file system to replace FAT16 and FAT32. They have done their best to make it appear as much as possible that most parts of DOS are gone, but ... DOS is still there. The parts that are still there are made to hidden from the user as much as possible.

You can do at least half of what you already do graphically through Windows by using a command prompt, and the command line of a virtual DOS box. The better you are at typing, the faster you will become at it, and the more rapidly you can execute commands to do things.

The command prompt is the cryptic prompt that you'll see on a DOS box whenever you start it up. You can make a DOS box appear whenever you want by pressing the Start button, selecting RUN on the menu that appears, and then by typing CMD on the white box and press enter.

To launch a DOS box on Vista or Windows 7, you would use the search bar after pushing the start button and type CMD then press enter. On Vista and Windows 7, the RUN option is replaced by the search bar (which you can type a command onto directly and then execute).

When the dos box appears, you'll see that it's like I said: a cryptic dark box. But don't be afraid of it! This is just a virtual DOS shell over top of Windows. You can exit out of it at any time by typing EXIT and pressing the enter key. You can exit out of a DOS box by just using your mouse to click the X (close button) on the upper right hand part of the dos box as long as you are not using the dos box with the full screen mode.

If you ever want to go between a full screen DOS box and a DOS window, hold the ALT key down and then press the ENTER key. It toggles the size of the DOS box for you. If you need to keep your DOS box full screen, but wish to switch to a Windows program, you can hold the ALT key down, and then press the TAB key (ALT+TAB) to switch to another program. If you hold on to the ALT key after you release TAB, you can hold ALT and press TAB repeatedly to select the program you want to switch to. When you arrive at the program you want to switch to, release the ALT key, and Windows will switch to that program.

If you switch back to a DOS box that is full screen, the Windows environment will reflect that whenever a full screen DOS box has focus. In MS-DOS (and clones such as FreeDOS and DRDOS), you can make a script of DOS commands that execute, ask questions, do limited Boolean comparisons and run other programs if programmed to. These scripts are called Batch Files, and are usually just text file scripts containing DOS commands. These files have a .BAT extension if you see them in a DOS box.

Below is a detailed compilation of DOS commands which will work on the virtual DOS box that is created whenever CMD is executed in Windows from the Start, Run box. Please be aware that many of the commands that will run out of a DOS box are made to call Windows programs and functions now, and would not normally exist on a true DOS operating system (such as FreeDOS or MS-DOS 6.22).

There are two lists below for you to make use of.

The first list has commands that I've found will work universally with all versions of Windows XP Home, Windows XP Professional and beyond. The second list will only work and be recognized on systems running Windows XP Professional or higher.

Some of the commands that run on either list will work with Windows 2000 and 2003 server also, but many of them will not because Microsoft used a different command name for some of them.

Most of these commands will also work with all versions of Vista and Windows 7, but I have not tested them thoroughly yet to see which will work with non-XP versions of Windows, and which will not. You are welcome to experiment if you like and see which ones are recognized, and which ones are not at your own risk.

A word of advice for anyone who is new and does decide to experiment: Try to avoid any commands which perform file manipulations of any kind unless you are sure of what you are doing! Unless you are using an emulator, the commands you execute from a DOS box can and will always affect or change the computer certain ways whenever you run them.

The majority of computers still run XP rather than Vista or Windows 7 at the time of this writing, so the concentration and focus for this article has been exclusively written with attention to compatibility for DOS environments that run upon Windows XP Home and Windows XP Professional. My tests were conducted with XP using Service Pack 3 in both cases.

There are some DOS commands on this last that you'll see have a "~" sign before them. This means that those DOS commands can be used universally with batch files, and should work just fine if run out of a DOS box on any version of Windows. They are able to work in most versions of real and true DOS as well (meaning, a computer where DOS is the only operating system installed). You will only see the ones listed with a "~" under the first list, since it is the list with the most compatibility.

DOS COMMANDS FOR XP HOME AND HIGHER (These commands will work with Windows XP Home and Windows versions beyond):

ARP Address Resolution Protocol

ASSOC Change file extension associations (use /? for help)

AT Schedule a command to run at a later time (use /? for help)

ATTRIB Change file attributes

CACLS Change file permissions

CALL Call one batch program from another

CD Change Directory - move to a specific Folder

CHKDSK Check Disk - check and repair disk problems

CHKNTFS Check the NTFS file system

CHOICE Accept keyboard input to a batch file

CleanMgr Automated cleanup of Temp files, recycle bin

~ CLS Clear the screen

CMD Start a new CMD shell

COLOR Change colors of the CMD window

COMP Compare the contents of two files or sets of files

COMPACT Compress files or folders on an NTFS partition

CONVERT Convert a FAT drive to NTFS.

~ COPY Copy one or more files to another location

DATE Display or set the date

Dcomcnfg DCOM Configuration Utility

DEFRAG Defragment hard drive

DEL Delete one or more files

DIR Display a list of files and folders

DISKCOMP Compare the contents of two floppy disks

DISKCOPY Copy the contents of one floppy disk to another

DOSKEY Edit command line, recall commands, and create macros

DSQUERY List items in active directory

ECHO Display message on screen

ENDLOCAL End localization of environment changes in a batch file

ERASE Delete one or more files

EXIT Quit the current script/routine and set an errorlevel.

EXPAND Decompress files

FC Compare two files

FIND Search for a text string in a file

FINDSTR Search for strings in files

FOR /F Loop command: against a set of files

FOR /F Loop command: against the results of another command

FOR Loop command: all options Files, Directory, List

FORMAT Format a disk

FSUTIL File and Volume utilities

FTP File Transfer Protocol

FTYPE Display or modify file types used in file extension associations

GOTO Direct a batch program to jump to a labeled line

HELP Online Help

IF Conditionally perform a command

IPCONFIG Configure IP

LABEL Edit a disk label

LOGOFF Log a user off

MEM Display memory usage

MD Create new folders

MODE Configure a system device

MORE Display output, one screen at a time

MOUNTVOL Manage a volume mount point

MOVE Move files from one folder to another

MSCONFIG Turn on and off services, start up items, boot, etc.

MSG Send a message

MSIEXEC Microsoft Windows Installer

MSTSC Terminal Server Connection (Remote Desktop Protocol)

NET Manage network resources

NETSH Configure network protocols

NBTSTAT Display networking statistics (NetBIOS over TCP/IP)

NETSTAT Display networking statistics (TCP/IP)

NSLOOKUP Name server look-up

PATH Display or set a search path for executable files

PATHPING Trace route plus network latency and packet loss

PAUSE Suspend processing of a batch file and display a message

PING Test a network connection

PRINT Print a text file

PROMPT Change the command prompt

PUSHD Save and then change the current directory

RASDIAL Manage RAS connections

RASPHONE Manage RAS connections

RECOVER Recover a damaged file from a defective disk.

REG Registry: Read, Set, Export, Delete keys and values

REGEDIT Import or export registry settings

REGSVR32 Register or unregister a DLL

REGINI Change Registry Permissions

REM Record comments (remarks) in a batch file

REN Rename a file or files.

REPLACE Replace or update one file with another

RD Delete folder(s)

ROUTE Manipulate network routing tables

RUNAS Execute a program under a different user account

RUNDLL32 Run a DLL command (add/remove print connections)

SC Service Control

SET Display, set, or remove environment variables

SETLOCAL Control the visibility of environment variables

SHARE List or edit a file share or print share

SHIFT Shift the position of replaceable parameters in a batch file

SHUTDOWN Shutdown the computer

SORT Sort input

START Start a program or command in a separate window.

SUBST Associate a path with a drive letter

TIME Display or set the system time

TITLE Set the window title for a CMD.EXE session

TLIST Task list with full path

TOUCH Change file timestamps

TREE Graphical display of folder structure

TYPE Display the contents of a text file

VER Display version information

VERIFY Verify that files have been saved

VOL Display a disk label

WINMSD Windows system diagnostics

XCOPY Copy files and folders

Here is my second list of DOS commands that I've tested and verified to work with Microsoft Windows XP Professional on the command line. These commands will not work with Windows XP Home, but many of them should still work with Vista Home or Vista Ultimate/Win7. It may be possible that Microsoft decided to keep conformity with the differences between "home" and "pro" versions of their Vista product, too. I haven't yet tested Vista or Windows 7 versions/pre-releases to see yet. So you may want to use these command lists seperately for Vista and Win7 products the same way I have them listed for Windows XP Home vs Windows XP Pro if that is the case.

DOS COMMANDS FOR XP PRO (These commands only work with Windows XP Professional or higher)

ADDUSERS Adds or lists users to or from a CSV file

ASSOCIAT One-step file association

BOOTCFG Edit the Windows boot settings

BROWSTAT Get the domain, browser and PDC info

CHANGE Change the Terminal Server Session properties

CIPHER Encrypt or Decrypt files and/or folders

CLEARMEM Clear any memory leaks

CLIP Copy STDIN directly to the Windows clipboard.

CLUSTER Windows Clustering

COMPRESS Compress files one at a time on an NTFS partition

CON2PRT Connect or disconnect a Printer from the computer

CSCcmd Client-side caching (of offline files)

CSVDE Import or Export Active Directory data

DELPROF Delete NT user profile(s)

DELTREE Delete a folder and all of its subfolders

DevCon The Device Manager Command Line Utility

DIRUSE Display current disk usage (equivalent of the Unix 'du' command)

DISKPART Disk Partition Management and Administration

DNSSTAT Get DNS Statistics

DSADD Add a user (computer, group..etc.) to active directory

DSMOD Modify a user (computer, group..etc.) in active directory

EXTRACT Uncompress CAB files

FORFILES Perform Batch process of multiple files

FREEDISK Check free disk space (in bytes)

GLOBAL Display membership of global groups

IFMEMBER Is the current user in an NT Workgroup

KILL Removes a program from memory

LOCAL Display membership of local groups

LOGEVENT Write text to the NT event viewer.

LOGTIME Log the date and time in a file

MAPISEND Send email from the command line

MBSAcli Baseline Security Analyzer.

MKLINK Create a symbolic link (linkd)

MOVEUSER Move a user from one domain to another

MSINFO Windows NT diagnostics

MUNGE Find and Replace certain text/ascii within file(s)

MV Copy files which are considered in-use by the system

NETDOM Domain Manager

NETSVC Command-line Service Controller

NOW Display the current Date and Time

NTBACKUP Backup folders to tape

NTRIGHTS Edit user account rights

PERMS Show permissions for a user

PERFMON Performance Monitor

POPD Restore the previous value of the current directory

PORTQRY Display the status of ports and services

PRNCNFG Display, configure or rename a printer

PRNMNGR Add, delete, list printers set the default printer

PsExec Execute process remotely

PsFile Show files opened remotely

PsGetSid Display the SID of a computer or a user

PsInfo List information about a system

PsKill Kill processes by name or process ID

PsList List detailed information about processes

PsLoggedOn Who's logged on (locally or via resource sharing)

PsLogList Event log records

PsPasswd Change an account password

PsService View and control services

PsShutdown Shutdown or reboot the computer

PsSuspend Suspend processes

QGREP Search file(s) for lines that match a given pattern.

RMTSHARE Share a folder or a printer

ROBOCOPY Robust File and Folder Copy

SCHTASKS Create or Edit Scheduled Tasks

SCLIST Display NT Services

SETX Set environment variables permanently

SHORTCUT Create a windows shortcut (.LNK file)

SHOWGRPS List the NT Workgroups a user has joined

SHOWMBRS List the Users who are members of a Workgroup

SLEEP Wait for x seconds

SOON Schedule a command to run in the near future

SU Switch User

SUBINACL Edit file and folder Permissions, Ownership and Domain

SYSTEMINFO List system configuration

TASKLIST List running applications and services

TASKKILL Remove a running process from memory

TIMEOUT Delay processing of a batch file

TRACERT Trace route to a remote host

USRSTAT List domain user names and last log-in

WHERE Locate and display files in a directory tree

WHOAMI Output the current UserName and domain

WINDIFF Compare the contents of two files or sets of files

WINMSDP Windows system diagnostics II

WMIC WMI Commands

XCACLSChange file permissions

Please note that on Windows, if you shut off a system service, certain calls from some commands may not execute as expected or run at all.

Be sure that the services you need are turned on if you suspect a command not working as it normally should or does on another machine running XP. Make sure that the system is aware of any service changes and that they can be accessed via the DOS box as-is (if not, you might need to start a new DOS box and continue in some cases to correct that on Win XP Home).

Sources:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

Published by James W.

Here to share information and talents.  View profile

  • Know how to use DOS on Microsoft Windows through a command prompt.
  • Find out which commands work with Windows XP Home, and which ones work only with XP PRO.
  • Find out what batch files do, and what their file extension is for DOS and Windows systems.
From Windows 1.0 to Windows 98 and ME...you would access DOS by typing out the word "command" on a RUN box, not cmd. Windows used to run over true DOS with command.com, not the NT virtual cmd that is used today.

1 Comments

Post a Comment
  • RetiredEngineer11/20/2009

    How can I download the whole DOS article at once, rather than page-by-page.

    Please send any reply to noffkehw@hotmail.com

    Tks
    RetiredEngineer

To comment, please sign in to your Yahoo! account, or sign up for a new account.