Pinterest Stumbleupon Whatsapp
Ads by Google

dos commandsI realize that providing a lesson on DOS commands to MUO readers is sort of like offering to teach a group of martial arts experts how to throw a punch. The thing is, there are quite a few people out there that don’t realize how easy it is to troubleshoot and fix certain computer issues using a few simple key entries. I’m not about to argue that DOS isn’t outdated. However, Windows 7 still features a command prompt window.

We’ve covered a number of current uses for DOS, such as  playing DOS games 7 Sites To Find The Best Classic DOS Games 7 Sites To Find The Best Classic DOS Games Read More . I also provided some Windows Scripting tips Better Than Batch: A Windows Scripting Host Tutorial Better Than Batch: A Windows Scripting Host Tutorial Read More , which is the next generation replacing DOS commands. With that said, there’s still a place for DOS commands. So, for those of you that like the idea of typing in a few commands to avoid the hassle of several mouse clicks, I’m going to review eight of what I consider to be the most essential and helpful DOS commands that are still available in Windows 7.

The DOS Prompt Window Is Not Missing!

If you are one of those folks that became convinced the DOS prompt was officially wiped out with Windows 7, all you have to do is click on the Start menu, and in the “Search programs and files” field, just type “cmd” and press enter. Voila – there’s your DOS window.

Assoc: Associated Extension

Not sure what default program you have set up to handle ZIP, MP3 or HTML files? A quick and easy way to check for your default file associations is the “assoc” command. Just open a command prompt and type “assoc” followed by the file extension.

dos commands

The response is the installed application that is currently configured to handle that file type. As you can see above, WinRAR is my ZIP file handler, MS Word handles doc files, and Chrome is set up as the default for HTML files.

Ads by Google

Tree: View Directory Structure

If you’ve created a virtual spiderweb of files and directories on your computer, it can get pretty confusing to remember where everything is. Sometimes it would be nice to have a diagram showing directories and sub-directories. Using the Tree command, you can do just that.

First, navigate to the directory you want to get the file structure of, and then type “tree > myfile.txt“. The text file can be called anything you like.

ms dos commands

The command writes the entire directory structure, completed with all folders, into the text file, which you can print out for easy viewing.

ms dos commands

The formatting may look a little bit funky, but if you look closely you’ll see that the directories are all there, they just might be prefaced with some weird symbols.

File Search & Comparison

If you ever have two text files – particularly two very large text files – the file compare (fc) command is all you need to identify and synchronize file differences.

The usage is about as easy as it can get. Just type “fc” followed by the names of the two files.

ms dos commands

The system will respond by showing the lines from both files where there are differences.  This command can become pretty handy when you’re collaborating with people and trying to sync up differences between files that several people are working on.

If you only need to find a file on your system, and you know the name of the file, the “find” command is far faster than any point and click operation you can do. Just do a “dir” command to the directory you want to search, and then “|” followed by the name of the file.

dos prompt commands

The system will respond with the directory where the file is stored.

Network Commands

I really don’t think there are easier ways available to do network troubleshooting than the sort of tools you get in DOS commands. For example, if you want to know your basic network setup, just do a quick “ipconfig” and you will get details like your computer IP and the default gateway (which is typically your home router IP address).

If you’re not sure you have a good network connection, try doing a “ping” to a known IP address or a website. You’ll see it echo back with an IP address if the link is good. If you want to see all network connections currently active from your PC, type “netstat“.

This shows you all network connections from your PC. It may be a good idea to search through these carefully to make sure that there’s no surprises in the form of malware or a virus hijacking your bandwidth.

Windows Utilities

Finally, there are a multitude of DOS commands that are invaluable as system troubleshooting tools. For example, to view a list of active processes, just open up a command prompt and type “tasklist“.

dos prompt commands

If you see any process you want to kill, just type “taskkill” follwoed by the image name.

Nervous about whether a particular system file became corrupted after a recent virus infection? Just type “sfc /VERIFYFILE=” followed by the full path of the file.

dos prompt commands

Windows will check to be sure it is the original. You can also scan all system files like this at once by typing “sfc /scannow

Finally, probably one of the most useful DOS commands available – the AT command. With “AT”, you have the ability to schedule tasks to run on a regular routine, all from a simple command prompt.

dos commands

Setting up the AT commands can be a little tricky, so type “at help” if you need parameter help. In the command above I set up the computer to automatically archive all files in the temp directory to the archive folder. You could do similar jobs to routinely back up important files on your computer to a mapped external drive.

As you can see, there’s still plenty that you can do with the command prompt. Having these resources at your fingertips can really make it a lot easier to troubleshoot, maintain and repair computer systems.

Were any of these commands new to you? Do you know of any other useful DOS tips? Share your insights in the comments section below.

  1. goldeneaglesystems
    May 10, 2016 at 2:07 pm

    What about pushd & popd?
    pushd - it allow you to move inside dirs no matter in what drive are placed, you only need to provide the full path (pushd %drive%\%rootdir%\%subdir%).
    popd - return to the initial drive/dir from pushd was called.

    Do you want to do that like this?
    C:\Users\Administrator\Desktop>E: + enter
    E:\>
    cd rootdir enter
    E:\rootdir>
    cd subdir enter
    E:\roodir\subdir>

    or you can do this much easier
    C:\Users\Administrator\Desktop>pushd E:\rootdir\subdir Enter
    E:\rootdir\subdir>

    return to prev dir, you only need to type "popd"
    E:\rootdir\subdir> popd Enter
    C:\Users\Administrator\Desktop

  2. Michelle DeView
    August 30, 2015 at 11:30 pm

    This article is the best read I have had in a long time. All of you guys rule. Thanks for making a boring Sunday afternoon into an educational and fun day. :) And, because I am a girl, I had
    to make my dos prompt window (command line window whatever) dark purple with lite purple text!!!!

  3. Martin Kuliza
    July 11, 2015 at 12:30 pm

    a Few Personal favourites of mine...

    these first few are very basic and hence why they were overlooked, but they are very useful timesavers when your under the pump and need to go fast.

    exit - very useful, since your fingers are already on the keyboard you don't need to go for the mouse and click the X

    cls - (Clear Screen Command) very useful when the window gets cluttered

    mkdir - (Make Directory / Create Directory / Create a New Folder). Now many may argue that
    you can do this faster by right clicking and selecting NEW and then FOLDER. well...
    if your client asks you for something like the need to create a folder for for this year
    and the past 6 years, and these folders are to be called 2009,2010,2011,2012,2013,
    2014.
    and then each year has to have 12 folders called 1.January,2.February etc all the way
    to 12.December
    if your ever in this situation, BELIEVE IT that the Mouse way will take forever,
    whereas if you do this....

    SYNTAX
    mkdir[SPACE][FOLDER][SPACE][FOLDER]
    Basically you can use a space or a , as a seperator

    so you would enter something like this...

    mkdir 2009 2010 2011 2012 2013 2014
    press enter and voila all the folders are created

    now you can use

    dir - (Directory) to bring up the current directory
    then you can use

    cd (change Directory) to change to a directory
    or
    cd.. (go back a directory level)
    then you enter
    mkdir january february march april may june july august september october november december

    then navigate to each year folder and press the UP ARROW and you'll get the command
    for all the years

    that should take around 5 mins using a CLI
    doing it with a mouse, i'm betting it'll take around 30 mins or so

    then we have

    rmdir (remove directory) this is basically DELETE.
    syntax
    rmdir [folder name] this also works if you type in rmvdir

    AS FOR NETWORKING
    ping has been covered
    i would like to add that i commonly use the switch -t .. eg. ping http://www.google.com -t
    (useful for when your troubleshooting dark spots in a wireless LAN and your walking around
    with a laptop for a period of time sniffing out black spots in a network)

    ipconfig has been covered
    netstat has been covered

    i have found
    flushdns to be very useful when you get those routers that will not let you into the Router Page.

    ipconfig /flushdns

    i have found also found
    ipconfig /release
    and
    ipconfig /renew
    to be invaluable

    i think these are the most common ones that i use

    winver (Windows Version) is another i use from time to time
    oh yeah and finally

    systeminfo (system information)
    very useful when your trying to figure out the motherbooard model so you can get the drivers
    from the web , but the system is in a weird position or your not allowed to open it
    also helps troubleshooting network issues like.. is the client on a workgroup or a domain

    it helps in lots of ways , go through the information and use your imagination

    that's all from me guys

    EXIT
    LOL :)

  4. Stephen Lackey
    June 11, 2015 at 4:23 pm

    If you ever find yourself wondering if your computer is using the LAN line it is connected to vs the WIFI it is also connected to..

    Route Print

    This will return the cost (metric) value associated to your paths... the lowest number always wins.

  5. Michael Leger
    June 14, 2011 at 8:24 pm

    net statistics server

    shows you when the system came online last, great for those mystery problems "did the server restart last night"

  6. Farrukh
    May 11, 2011 at 7:38 am

    With Tree command, you can use /A to get some better format to save in .txt files.

    To get a list of available DOS commands, type

    "Help | More
    "

    and press enter

    To get a quick help for any command, type:

    command /?

    and press enter.

    e.g. to get help about If command, type "if /?" and press enter

    • Anonymous
      May 12, 2011 at 11:12 pm

      Thanks Furrukh - yes, Tree is a great command to get a graphical display of the directory structure, great one!

  7. Daniel Strom
    May 9, 2011 at 6:57 pm

    IIRC, you don't need to pipe dir output through find to find a file. You can just 'dir /s /b filename.ext'. Unless I'm mistaken, this worked in DOS, and I don't know why they would have changed it (I now use a tool called everything from voidtools.com, so I haven't needed to search from cli in a while).

  8. Daniel Strom
    May 9, 2011 at 4:57 pm

    IIRC, you don't need to pipe dir output through find to find a file. You can just 'dir /s /b filename.ext'. Unless I'm mistaken, this worked in DOS, and I don't know why they would have changed it (I now use a tool called everything from voidtools.com, so I haven't needed to search from cli in a while).

  9. Dhawal D
    May 9, 2011 at 3:42 pm

    wow, Amazing~ i didn't know some of them, probably 'copy con' command can be added to the list, some useful batch operations can be carried out.

  10. Jone
    May 6, 2011 at 10:05 am

    Very interesting, here is a software
    that Send email from a DOS batch script.http://www.soft85.com/get/Prog...

  11. Andrei
    May 5, 2011 at 6:52 pm

    I use xcopy for large batches of files that do not have any continuity. Saves lots of work

  12. Scutterman
    May 5, 2011 at 8:14 pm

    I used to use the AT command to run Solitaire when logged in without permission to run it (AT would run the process as system rather than user).

    I use tracert whenever ping succeeds but internet is not working, to narrow down the problem, and I also use commands like "sc stop wuauserv" to prevent windows update asking me to restart every fifteen minutes (or 4 hours with W7) (source http://uk.lifehacker.com/28999...

  13. Scutterman
    May 5, 2011 at 6:14 pm

    I used to use the AT command to run Solitaire when logged in without permission to run it (AT would run the process as system rather than user).

    I use tracert whenever ping succeeds but internet is not working, to narrow down the problem, and I also use commands like "sc stop wuauserv" to prevent windows update asking me to restart every fifteen minutes (or 4 hours with W7) (source http://uk.lifehacker.com/289998/disable-windows-update-restart-nag)

  14. Matijag
    May 5, 2011 at 5:08 pm

    If you use tree /a > tree.txt, you won't get "funky formatting" necause you'll use ASCII. Check tree /? for more help.

  15. Mike Edgerton
    May 5, 2011 at 2:58 pm

    I don't have a W7 machine in front of me right now to test but I'm willing to bet that a DIR /S >myfile.txt will give you a real picture of the directory structure as opposed to the convoluted results of that Tree command. Another thing to remember is that batch files are your friends.

  16. Happyday628
    May 5, 2011 at 11:34 am

    MPEG Converter for Mac is the best .MPG Converter Mac OS software to convert various video formats including MPEG4, iPod Touch MPEG4, iPod Nano MPEG4, iPhone Video MPEG4, iPhone Video H.264, Apple TV MPEG4, M4v-MPEG4 and so on. MPEG Converter for Mac can convert popular video formats to be played ony portable devices like iPod, iPhone, Apple TV, Zune, PSP, Video capable MP4 players, etc.

  17. Mukul Gupta
    May 5, 2011 at 7:46 am

    attrib as well ;)

    syntax attrib [+R | -R] [+A | -A] [+S | -S] [+H | -H] path/filename.extension [/S]

    well everything can be done using GUI now a days ... but still a useful trick if ur GUI gets infected by some trojan or something and u cant see hidden files .. etc

  18. Lee
    May 5, 2011 at 6:57 am

    Wouldn't "dir c: /s/b screenkill.wsf" will give you the same results without using the |FIND command?

  19. vjmaliyil
    May 5, 2011 at 7:17 am

    Not always will you come across an article which you can actually use. This is one such article which you can use in your daily life. Awesome commands. And I thought I knew DOS :). I have a few Ideas where I can use the AT command. I can use FC for my daily work. Great share. I have been following makeuseof.com for an year now. And I wanted to leave a comment for the awesome info.

  20. vjmaliyil
    May 5, 2011 at 5:17 am

    Not always will you come across an article which you can actually use. This is one such article which you can use in your daily life. Awesome commands. And I thought I knew DOS :). I have a few Ideas where I can use the AT command. I can use FC for my daily work. Great share. I have been following makeuseof.com for an year now. And I wanted to leave a comment for the awesome info.

  21. Erik Eckhardt
    May 5, 2011 at 1:15 am

    You can even do things like compare lists of files to find which ones match with interesting things like this:

    for %e in (filespec.*) do if exist otherdirectory%e move %e match

    A very similar technique can copy all missing windows fonts to your own computer from another computer. Doing this through the GUI would be a nasty, laborious, painful process.

    c:
    cd windowsfonts
    for %E in (\othercomputerc$windowsfonts*.*) do if not exist "%~nxE" copy "%E" .

  22. Nickinzim
    May 5, 2011 at 12:59 am

    One of the one's surprisingly not in the list (even though you mention it) is the humble and ever useful "Ping" command, which I use this on a regular basis, and sometimes to go with it "arp -a" to find MAC addresses easily if I need to add to a MAC filter.

    • Guest
      May 5, 2011 at 1:16 am

      they mentioned ping... "f you’re not sure you have a good network connection, try doing a “ping” to a known IP address or a website."

  23. Paul G
    May 5, 2011 at 12:47 am

    I miss deltree since installing Win 7 64 :-(

  24. Marty Monster
    May 5, 2011 at 12:22 am

    I find myself always using the file redirect '>'.

    And still use the FOR IN DO command about once per month.

    Many things DOS can do Windows still cant do......

  25. Jim
    May 4, 2011 at 11:47 pm

    Thanks. If you don't learn something new everyday...You're going backwards. As a System Admin, I still use the "DOS commands/CLI". Sometimes nothing else works without a hassle.

  26. Dana Fellows
    May 4, 2011 at 11:04 pm

    Dos is dead. The Command Line Interface is not the exact same as DOS. You don't bring up a DOS window but rather a Command Line Interface.

    • Agreton
      May 4, 2011 at 11:19 pm

      Considering that some people in the world are not technologically savvy, as well as the fact that this site "MakeUseOf" is here to help people, arguing semantics is pointless. Especially if you consider that an older generation than yours might have only knowledge of Dos, and after version x upgrade never bothered to use a command prompt after say windows 95, or windows xp.

      Aside from that, to many commands are similar in the command line interface to old dos commands for it not to be known as dos. It is what it is, but it's called both. Compare it to old Mac computers where you had to type "cat" in the command line to bring up a directory listing. the 'dir' command uses almost exactly all of the same functionality as the old dos command had.

      Again, why argue semantics? This article servers a purpose.

      • Marcleon
        May 5, 2011 at 3:40 am

        We, the basic windows users call it the Dos prompt because some time, somebody ( (Microsoft) called it that way. It's a command console but you shouldn't use those words because otherwise people will know you have a unix like system alongside your windows.

Leave a Reply

Your email address will not be published. Required fields are marked *