Home Software A Compilation of Command Prompt Tips, Tricks & Cool Things You Can...

A Compilation of Command Prompt Tips, Tricks & Cool Things You Can Do

Although Windows’ settings present quick access for configuring most issues, the Command Prompt — elevated or in any other case — will be indispensable in plenty of eventualities, particularly when you know the way to reap the benefits of it.

Sometimes settings will be utilized by typing just a few characters as an alternative of clicking by means of a collection of menus, whereas different instances there merely is not some other option to carry out an operation besides with command traces.

We’ve compiled a listing of issues that you are able to do within the Windows Command Prompt, together with some commands everybody ought to know for common utilization, extra superior ones for tweaking or troubleshooting your PC, in addition to lesser recognized and fewer sensible Command Prompt options. Our checklist of ideas and methods beneath has been organized from briefest and most helpful, to extra complicated and dangerous…

Stop any command mid-operation

Since you may be testing some instructions… urgent Ctrl + C will cancel a command that you have already entered and help you start typing one other one, whereas typing cls will clear the present window of any instructions that you have entered.

Did you already know there’s a settings menu?

Right-click the title bar and open Properties for settings that embody the power to alter your Command Prompt’s font, structure and colours, in addition to choices akin to Quick Edit mode, which is able to mechanically paste textual content out of your clipboard while you proper click on within the window.

Bonus: You can customise the textual content within the high bar by typing title adopted by the textual content that you really want (instance: title My title was pasted with Quick Edit mode).

Command Prompt keyboard shortcuts

Tapping the up and down arrows in your keyboard will cycle by means of instructions that you have beforehand entered. More shortcuts:

Tab: When you are typing a folder path, tab will auto-complete and cycle by means of directories
Ctrl + M: Enables Mark Mode which helps you to transfer the cursor in all instructions with the arrow keys
Ctrl + C or V: As of Windows 10, you’ll be able to copy and paste with management C and V like elsewhere across the OS
Ctrl + F: Likewise, management + F now permits you to seek for textual content within the Command Prompt
Ctrl + Shift + Scroll in your mouse: Increases or decreases the window transparency (+ and – keys work too)
Alt + Enter: Enables full-screen mode with no title bar displayed on high (F11 additionally works like elsewhere in Windows)

Drag and drop folders to insert a listing path

Directory paths do not should be typed within the first place. Aside from with the ability to copy/paste textual content and tab by means of directories, you’ll be able to drag and drop a folder immediately into the Command Prompt window to mechanically insert the situation.

The operate keys F1-F9 are additionally shortcuts

The operate (F) keys on the highest of your keyboard are additionally shortcuts that principally re-enter earlier instructions with out retyping them.

  • F1: Tapping or holding this key will retype the command that you simply simply entered letter by letter.
  • F2: Copies the present command as much as a specified character.
  • F3: Completely retypes the earlier line that you simply entered.
  • F4: The reverse of F2 — auto-deletes as much as a specified character (your cursor should be in entrance of the textual content).
  • F5: Retypes the earlier command like F3 however permits you to cycle again by means of many traces in your command historical past.
  • F6: Inserts Ctrl+Z (^Z) within the Command Prompt, which is an end-of-file indication (textual content after that is ignored)
  • F7: Opens a listing of beforehand entered instructions you could choose from.
  • F8: Works like F5 however would not cease on the finish of your command historical past, cycles again to the beginning.
  • F9: Lets you retype a earlier command by getting into a quantity related to the road.

Enter a number of instructions directly

Adding && between instructions will allow you to enter a number of traces directly to be executed in succession. Example:

tasklist && netstat -b

See each course of operating and linked

Entering tasklist command will checklist all the processes operating in your machine together with particulars akin to their course of identifier and reminiscence utilization, whereas netstat -b will generate a listing of all of the processes with a longtime community connection.

List each system driver in your PC

There are some ways to generate a listing of drivers within the Command Prompt, this is one line that features further info such because the standing of a tool and the folder location/file title of the related driver:

driverquery /FO checklist /v

Output outcomes to textual content file or clipboard

You can save the output of a command akin to tasklist or driverquery to a brand new textual content file by including > together with a listing and file title. Example:

driverquery > C:UsersTechSpotDesktopoutput.txt

Delete short-term information out of your drive

Some of the short-term information in your drive will be deleted with the next instructions (/q runs the operation with no affirmation immediate, /f ignores the read-only attribute and forces deletion, /s deletes contents from all sub-folders):

  • Delete short-term person information: del /q /f /s %temp%*
  • Delete short-term system information (requires admin rights): del /s /q C:Windowstemp*
  • …Or run them collectively: del /q /f /s %temp%* && del /s /q C:Windowstemp*

If that did not empty sufficient storage, listed here are extra temp folder locations, and we not too long ago coated a bunch of the way to liberate house on Windows, together with Command Prompt strategies to launch a sophisticated Disk Cleanup instrument and one other to disable hibernation by deleting the function’s system file (hiberfil.sys).

Open Windows’ on-screen keyboard

Entering osk right into a Command Prompt opens Windows’ on-screen keyboard which helps you to click on keys along with your mouse as an alternative of typing them.

Shutdown your PC at a sure time

The “shutdown” command can be utilized with a variety of switches to shutdown, reboot and extra, together with the power to pressure functions closed, to show a message on shutdown, and to specify the variety of seconds you want earlier than the operation occurs. Example: shutdown -s -t 3600 would shutdown your PC in a single hour.

Create a Wi-Fi hotspot & Find your Wi-Fi password

If your community adapter helps the function, you’ll be able to configure your PC to be a wi-fi hotspot from the Command Prompt.

How to verify in case your {hardware} is succesful: Enter netsh wlan present drivers and search for the road that reads “Hosted network support: Yes.”

From there, you’ll be able to allow the hotspot with this command: netsh wlan set hostednetwork mode=enable ssid=YOURSSID key=YOURPASSWORD

Also enter this line to allow the hotspot: netsh wlan begin hostednetwork (cease works too) and you may verify the standing of your new hotspot by getting into netsh wlan present hostednetwork.

You can also should navigate by means of some GUI menus to allow connection sharing (we could not discover a approach to do that from the Command Prompt): Go to Network and Sharing > Change adapter settings (Control PanelNetwork and InternetNetwork Connections) and it is best to see the community adapters linked to your PC.

Right click on the system that’s linked to the Internet (not your new hotspot if that is listed) and open Properties. In the Sharing tab, verify the field to “Allow other network users to connect through this computer’s Internet connection.”

Among different netsh commands, the function can present your Wi-Fi password by getting into netsh WLAN present profile title=YOURPROFILE key=clear (look below Security settings > Key Content).

This line can delete a community profile you are now not utilizing: netsh WLAN delete profile title=YOURPROFILE

Quick repair instructions for connection points

Trouble along with your connection? ipconfig has some go-to instructions to resolve the difficulty:

  • ipconfig /launch (Releases your at present issued native IP handle)
  • ipconfig /renew (Requests a brand new native IP handle)
  • ipconfig /flushdns (Resets the contents of the DNS consumer resolver cache)

For persistent points along with your connection, there are some extra elaborate instructions which can be value making an attempt. Note that you’ll have to reconfigure your community adapter and so on. if in case you have handbook settings, significantly when resetting TCP/IP and the Windows Firewall.

These instructions require a reboot.

  • netsh winsock reset (Resets the winsock catalog to its default state, eradicating layered service suppliers — netsh winsock present catalog lists these things)
  • netsh int ip reset all (Removes and reinstalls TCP/IP, rewriting a few related registry keys)
  • netsh advfirewall reset (Restores the Windows Firewall to default settings, deleting beforehand configured guidelines and so on.)
  • nbtstat -r (Purges the contents of the NetBIOS title cache after which reloads the #PRE-tagged entries from the Lmhosts file)
  • nbtstat -rr (Releases after which refreshes NetBIOS names for the native laptop that’s registered with WINS servers)

Quick repair instructions for boot points

Are you greeted with a message that reads “reboot and select proper boot device?” or “NTLDR is missing” while you flip in your PC? The methodology beneath has labored for us to restore a Windows eight machine and ought to be legitimate for different editions of Windows.

Note that these traces should be entered in a Command Prompt that’s opened in a restoration surroundings from outdoors of your working system, akin to from a bootable USB drive with Windows 10 set up media.

  • bootrec /fixmbr
  • bootrec /fixboot
  • bootrec /scanos
  • bootrec /rebuildbcd

Although that sequence has labored for us up to now, we examined this on a digital machine by deleting the system reserved partition (the place boot info is saved) and making an attempt to revive the bootable state by getting into these traces. Unfortunately, entry was denied for bootrec /fixboot and we could not discover a workaround, so Windows nonetheless could not load.

However, these bcdboot and bootsect instructions labored to get Windows booting once more, although we simply reformatted the system partition:

  • bcdboot C:Windows (Recreates the system partition information with these copied from C:Windows. While this format works from inside Windows, see the word beneath about operating this command from a restoration console outdoors of Windows).
  • bootsect /nt60 SYS /mbr (Rewrites grasp boot code on the system partition and updates your grasp boot report)

*Note: If you are attempting to run bcdboot C:Windows from a restoration console outdoors of your Windows set up (akin to from the Windows 10 set up media), C:Windows might be D:Windows (your working system) whereas C: might be your system partition (the boot information). Entering diskpart after which checklist vol will show drive volumes so you already know what’s what (kind exit to shut diskpart). To run the bcdboot operation from a restoration surroundings, you need one thing like this command: bcdboot D:Windows /s C:


Master Boot Record – The first sector on the complete drive and incorporates a boot loader in addition to details about partitions on the drive.

Volume Boot Record (aka Partition Boot Sector/System Partition in MS terminology) – The first sector on a partition containing info to load an operation system.

Quick repair instructions for repairing Windows

Still cannot boot into Windows? Experiencing bluescreens or another bug? Windows has built-in instruments to scan for and substitute corrupt system information:

  • sfc /scannow (from inside Windows)
  • sfc /scannow /offbootdir=D: /offwindir=D:Windows (from outdoors Windows, akin to from a restoration drive)

A separate DISM command can scan the Windows part retailer for corrupt information and mechanically restore them:

  • DISM /Online /Cleanup-Image /RestoreHealth (from inside Windows)
  • DISM /Image:D: /Cleanup-Image /RestoreHealth (from outdoors Windows)

Encrypt, compress or backup information

Files and folders will be encrypted or compressed after which unencrypted and decompressed with fast particular person instructions for every operation — be sure to change the goal vacation spot:

Encrypt a file or folder: cipher /e C:UsersTechSpotDesktopFolder (listed here are extra cipher commands — /h applies a hidden attribute)

Decrypt that file or folder: cipher /d C:UsersTechSpotDesktopFolder

Compress a file or folder: compact /c /s:C:UsersTechSpotDesktopFolder

Decompress a file or folder: compact /u /s:C:UsersTechSpotDesktopFolder

You can create semi-incremental file backups utilizing robocopy, although that is extra concerned than the earlier instructions.

There’s an incredible Super User thread discussing the topic the place variants of the identical command are really useful for having robocopy do primary file backups, copying information from one location to a different — however solely when adjustments have been made.

Here’s probably the most recommended command (see the hyperlink for an evidence on the choices):

robocopy C:supply M:vacation spot /MIR /FFT /R:3 /W:10 /Z /NP /NDL

Generate stories about your system

These stories are surprisingly detailed and should assist in understanding points involving your system’s energy consumption or wi-fi connectivity.

powercfg /vitality (Generates a report in regards to the vitality effectivity of your system — the situation of the report is talked about after the command finishes)

powercfg /batteryreport (Generates a report with specs on your battery in addition to stats and graphs in regards to the historical past of your battery utilization)

netsh wlan present wlanreport (Generates a report with specs on your wi-fi {hardware} together with details about your connection historical past)

Watch an ASCII model of Star Wars Episode IV

Quite a lot of old-fashioned telnet providers are nonetheless accessible, together with the power to observe Star Wars Episode IV.

Enter telnet towel.blinkenlights.nl right into a Command Prompt for the film to start out (there isn’t any sound).

Note: If the command is not acknowledged, you might need to allow telnet. Search Start or the Control Panel for “Turn Windows features on or off” and verify the field subsequent to Telnet (click on Ok…).

More places you’ll be able to go through telnet:

telnet towel.blinkenlights.nl 666 (a “bastard operator from hell” excuse generator)

telnet telnet.wmflabs.org (Wikimedia)

telnet rainmaker.wunderground.com (Weather Underground)

telnet aardmud.org 4000 (Aardwolf)

telnet achaea.com 23 (Achaea)

telnet ateraan.com 4002 (New Worlds – Ateraan)

telnet avalon-rpg.com 23 (Avalon: The Legend Lives)

telnet batmud.bat.org 23 (BatMUD)

telnet eclipse.cs.pdx.edu 7680 (New Moon)

telnet forgottenkingdoms.org 4000 (Forgotten Kingdoms)

telnet freechess.org 5000 (Free Chess)

telnet igormud.org 1701 (IgorMUD)

telnet lord.stabs.org 23 (Legend of the Red Dragon)

telnet mush.shelteringcolorado.com 2601 (Sheltering Sky: Colorado by Night)

telnet zombiemud.org 23 (Zombie MUD)

Note: This function was initially revealed on 10/23/2018. We have bumped it because of its old-fashioned nature, as a part of our #ThrowbackThursday initiative.

More Useful Tips

Most Popular

Recent Comments