Defrag Tools #195 - Console Command Favorites

Play Defrag Tools #195 - Console Command Favorites
Sign in to queue


In this episode of Defrag Tools, we geek out on our favorite Command Prompt commands.

Command covered:

where.exe - Where

Shows where a executable/script is on the PATH environment variable

  • where notepad.exe

ipconfig.exe - IP Configuration

IP Address Configuration - Basic

  • ipconfig

IP Address Configuration - Advanced/All

  • ipconfig /all

IP Address Renewal/Reset

  • ipconfig /flushdns
  • ipconfig /release
  • ipconfig /renew
  • ipconfig /registerdns

findstr.exe - Find String

  • /s - Sub Directories
  • /n - Line Number
  • /p - Search Pattern. e.g. Foo*Bar to match: Footastic Barcode
  • /c - Escaped characters. e.g. /c:"\"Foo\" Bar" to find the text: "Foo" Bar

Contact us at and/or @defragtools





The Discussion

  • User profile image

    where doesn't seem to work in PowerShell.

  • User profile image

    Win+R =>  sysdm.cpl is a faster way to bring up the system properties dialog

  • User profile image

    @jlomax:In PowerShell you have to type where.exe for it to work. 

  • User profile image

    @jlomax - because "where" is an alias in PowerShell referring to Where-Object

    @defrag team, you guys need to spend some time with Jeffrey Snover!

  • User profile image


    if you really want device manager the use hdwwiz.cpl instead.

    and if you prefer a perticular page of one of those elements
    then for example control sysdm.cpl,,2 opens the 2nd page where the device manager button is

  • User profile image

    Great episode guys!

    really cool.

    one of my favorite Win+R shortcuts is: compmgmt.msc

    I use this to easily check out the SQLSErvr running services and manage storage too. 

    Best Wishes.


  • User profile image
    Kurs Christian

    more like this, very interest in more Windows Internals and Commands.

    very fine!.

    best regards


  • User profile image

    Win+Pause HYPE! I am constantly trying out various Win+[some other key] combos when I have a few seconds over (loading screens) in hope of finding a new super useful shortcut key like Win+Shift+S. [H] Didn't know about Win+Pause! Thanks a bunch!

  • User profile image

    qwinsta & rwinsta - I don't use them every day, but probably every month.

  • User profile image

    I know of commands:

    • dir
    • tracert
    • ping
    • ver
    • route
    • start
    • netstat
    • ipconfig
    • win
    • config.sys
    • exit
  • User profile image

    This is commands I using and use in Windows 7, 8 and XP.

  • User profile image

    One of the best "type <file> | findstr [options]". However there is a /A option to findstr where you should be able to specify a color code as defined in "color /?" however I have never seen this work. The Linux guys always rub it in that grep does this automatically. Have you been able to get the /A option to work with findstr?


    netsh int ipv4 show config    // I like the format better

    nltest.exe // dsgetdc: favorite

    cmdkey.exe // cached credentials

    dsquery // ldp filter syntax :)

    sc.exe // many uses

    gpresult.exe // "/r scope:computer" favorite

    w32tm.exe // domain time <3 kerb

    reg.exe // many uses

    dism.exe // many uses

    robocopy.exe // many uses including deleting data


    Some of my other most used are actually vbs

  • User profile image

    dir /s/a/b xxx.txt: find a file hidden or otherwise called xxx.txt with a nice clean path

    set dircmd=/ogen: set default sorting for dir command (sort/group by subfolders, then extension, then name)

    hostname: get the hostname

    whoami: who is you current user running context

    set devmgr_show_nonpresent_devices=1: show disconnected devices in device manager when enabling hidden devices


  • User profile image

    I've written a tool to specifically store and organize all the command line tools that I use so that I can easily reuse the command. Check it out at

  • User profile image
    The main reason I use 'where' through the PATH is to find the latest, greatest version of Dbghelp.dll, WinDiff, etc. The more SDK's installed, the more versions you might have.

    where.exe is also great for finding files that are not in the PATH. Type
    where /?
    to see how to do a recursive search from anywhere. Don't forget the /T.
  • User profile image
    The /P for findstr.exe is don't show non-printable results. This avoids seeing compiled/linked files that might match your search string.

    I find find.exe useful for streams. I often pipe 'findstr' results to 'find' similarly to how Andrew pipes to 'findstr' repetitively.

Add Your 2 Cents