Close
    Search Search

    Command Prompt: Top 10 Windows CMD Commands

    Command Prompt: Top 10 Windows CMD Commands

    If you find the commands of the Windows Command Prompt tool boring, maybe you're not using them right, because after you know the commands, you'll see that many of them are very fun, and bring practicality to the use of your operating system. Here we are going to look at some of these Command Prompt tricks, both the funniest and the most useful you can do with certain CMD commands.

    How to use command prompt in Windows 10?

    For those who are not yet familiar with the command prompt, to start it just type in the Windows search bar "CMD". Right-click the CMD to run it as an administrator.



    Alternatively, you can also open Run (Windows + R) and type cmd, then press enter.

    The most important CMD commands

    nslookup: find the IP address associated with a domain

    When you type a domain name (for example, into a browser address bar), your computer looks for the IP address associated with that domain name. You can use nslookup to find out this information.

    For example, you can type "nslookup techlifers.com" at the command prompt to quickly find out the server's assigned IP address. You can also perform a reverse lookup by typing in an IP address to find the associated domain name.

    cipher /w:c: Permanently delete files from HD

    When you delete files from a hard drive, you don't actually delete them, but mark the files as no longer accessible and the space they occupy as free. Files remain recoverable ​​until the system replaces them with new data, which can take some time.



    The cipher command, however, cleans up a directory by writing random data to it. To wipe your C drive, for example, you would use the command "cipher /w:c", which will clear the free space on the drive. The command does not overwrite undeleted data, so you will not delete necessary files by running this command, only what you have already deleted.





    ipconfig / flushdns: flush your DNS cache

    If you change your DNS server, the effects will not take place immediately. Windows uses a cache that remembers incoming DNS responses, saving you time when you access the same addresses again in the future.

    To ensure that Windows is getting addresses from the new DNS servers instead of using old cached entries, run ipconfig /flushdns after changing the DNS server.

    ping and tracert: Troubleshoot network connection

    If you are experiencing problems connecting to a website, or other network connection problems, Windows and other operating systems have some standard tools that you can use to identify problems.

    First, there's the ping command. Type, for example, "ping techlifers.com" (or whatever internet server you want to test) and Windows will send packets to that address. You can use a name or the real IP address. The server at that IP address will respond and let you know that it has been received.



    You will be able to see if any packets did not reach the destination - perhaps you are experiencing packet loss - and how long it took to get the response - perhaps the network is saturated and the packets take a while to reach their destinations.

    The tracert command traces the route needed for a packet to reach a destination, and displays information about each hop along that route. For example, if you run "tracert techlifers.com", you will see information about each node the packet interacts with to reach our server. If you're having trouble connecting to a site, tracert can show you where the problem is occurring.

    sfc /scannow: Scan system files for problems

    Windows includes a system file scanner tool that scans all files and looks for problems. If system files are missing or corrupt, System File Checker will repair them. This may fix issues on some Windows systems. To use this tool, open a command prompt window as an administrator and run the command sfc /scannow.

    netstat -an: List network connections and ports

    The netstat command is very useful as it displays all sorts of network statistics when used with its various options. One of the more interesting variants of netstat is netstat -an, which will display a list of all open network connections on your computers, along with the port they are using and the external IP address they are connected to.

    Driverquery: Find missing drivers

    Drivers are among the most important software installed on a PC. Missing or misconfigured drivers can cause all sorts of problems, so it's good to have access to a list of what's on your PC. That's exactly what the "driverquery" command does. You can extend it to "driverquery -v" for more information, including the directory where the driver is installed.



    systeminfo: System information

    This command will give you a detailed overview of your computer's configuration. The list covers your operating system and hardware. For example, you can search for the original Windows installation date, last boot time, BIOS version, total and available memory, installed hotfixes, network card settings, etc.

    Use "systeminfo" followed by the hostname of a computer on your local network to remotely get that system information. This may require additional syntax elements for the domain, username, and password, like this: "system info / s [hostname] / u [domain] [username] / p [username]"

    shutdown: Advanced boot options

    Windows 8 introduced the shutdown command to shut down or restart the computer. This may even seem useless as you can use the Windows function to shut down the system more easily. However, what is not useless is that the "shutdown" command, combined with a few letters (as you can see in the examples below), allows you to restart your PC in the advanced boot options menu, where you can access Safe Mode and Windows recovery utilities.

    Examples of use

    • shutdown /c (comment out the reason for shutdown or restart)
    • /r (complete shutdown and computer restart)
    • /s (shuts down the computer)
    • /f forces shutdown (terminates open programs)
    • /a (cancels all commands)
    • /i (display the graphical user interface - GUI).
    • /l (log off. Not to be used with the /m or /d option)
    • /g (complete shutdown and restart the computer. After the system reboots,
      if Auto Restart Logon is enabled, log in automatically and lock out the last interactive user. After signing in, restart all registered apps)
    • /p (shut down the computer without any timeouts or warnings)
    • / h (hibernate or computer)
    • /hybrid (performs a shutdown of the computer and prepares it for fast boot)
      Must be used with the /s option.
    • /fw (combining with a shutdown option may cause the next boot to go to the
      firmware user interface)
    • /e (document the reason for an unexpected computer shutdown)
    • /o (goes to advanced restart options menu by restarting the computer)
      Must be used with the /r option.
    • /m computer (specify target computer)
    • /t xxx (set the timeout period before shutdown to xxx seconds)
      The valid range is 0 to 315360000 (10 years), with a default of 30.
      If the timeout is greater than 0, the /f parameter will be
      implicit.
    • /c "comment" (comment the reason for restart or shutdown)
    • /f (force close running applications without prompting users)
    • /d [p|u:]xx:yy (gives the reason for restart or shutdown)
      p indicates that a restart or shutdown is planned.
      u indicates that the reason is user defined.
      If neither p nor u is specified, restart or shutdown will not be
      Not planned.
      xx is the primary reason number (positive integer less than 256).
      yy is the secondary motif number (positive integer less than 65536).

    So, did you like our list of commands? Is there any that you think should be here? Let us know what you think in the comments section below!

  • add a comment of Command Prompt: Top 10 Windows CMD Commands
    Comment sent successfully! We will review it in the next few hours.

    End of content

    No more pages to load