Wednesday, November 25, 2020
Home TECH A Compilation of Command Prompt Ideas, Tricks & Cool Things You Can...

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

0
19

Though Home windows settings present easy accessibility for configuring most issues, the Command Prompt — elevated or in any other case — might be indispensable in a quantity of eventualities, particularly when you know the way to take benefit of it.

Typically settings might be utilized by typing just a few characters as a substitute of clicking via a collection of menus, whereas different occasions there merely is not every other option to carry out an operation besides with command strains.

We have compiled a listing of issues that you are able to do within the Home windows Command Prompt, together with some instructions 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 record of ideas and methods under has been organized from briefest and most helpful, to extra advanced and dangerous…

Cease any command mid-operation

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

Drag and drop folders to insert a listing path

Listing paths do not need to be typed within the first place. Other than with the ability to copy/paste textual content and tab via directories, you may drag and drop a folder immediately into the Command Prompt window to robotically insert the placement.

Zoom in (and out)

The command immediate used to scale fairly poorly and present very small textual content, however now it has been modernized so you may zoom in similar to you do in an online browser. Use Ctrl + Mouse Wheel Up/Right down to zoom out and in textual content.

Do you know there’s a settings menu?

Proper-click the title bar and open Properties for settings that embrace the flexibility to alter your Command Prompt’s font, structure and colours, in addition to choices akin to Fast Edit mode, which is able to robotically paste textual content out of your clipboard if you proper click on within the window.

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

Command Prompt keyboard shortcuts

Tapping the up and down arrows in your keyboard will cycle via instructions that you’ve got beforehand entered. Extra shortcuts:

Tab: Whenever you’re typing a folder path, tab will auto-complete and cycle via directoriesCtrl + M: Allows Mark Mode which helps you to transfer the cursor in all instructions with the arrow keysCtrl + C or V: As of Home windows 10, you may copy and paste with Ctrl + C and V like elsewhere across the OSCtrl + F: Likewise, Ctrl + F now helps you to seek for textual content within the Command PromptCtrl + Shift + Scroll in your mouse: Will increase or decreases the window transparency (+ and – keys work too)Alt + Enter: Allows full-screen mode with no title bar displayed on prime (F11 additionally works like elsewhere in Home windows)

Enter a number of instructions without delay

Including && between instructions will allow you to enter a number of strains without delay to be executed in succession. Instance:

tasklist && netstat -b

See each course of working and related

Coming into tasklist command will record all of the processes working 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.

Record each machine driver in your PC

There are a lot of methods to generate a listing of drivers within the Command Prompt, this is one line that features extra data such because the standing of a tool and the folder location/file identify of the related driver:

driverquery /FO record /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 identify. Instance:

driverquery > C:UsersTechSpotDesktopoutput.txt

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: Fully retypes the earlier line that you simply entered.

F4: The reverse of F2 — auto-deletes as much as a specified character (your cursor have to be in entrance of the textual content).

F5: Retypes the earlier command like F3 however helps you to cycle again via many strains 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 can choose from.

F8: Works like F5 however does not cease on the finish of your command historical past, cycles again to the beginning.

F9: Enables you to retype a earlier command by getting into a quantity related to the road.
Use the Home windows Terminal

A new function within the newest Home windows 10 builds is the Home windows Terminal, accessible as a free obtain from the Microsoft Retailer. The Terminal is a modernized command line instrument that provides a tabbed interface in which you’ll open a number of command strains, but additionally the PowerShell, SSH connections and the Home windows Subsystem for Linux (WSL), making it a really versatile possibility for command line customers.

The Home windows Terminal is getting frequent updates and assist for contemporary options akin to GPU accelerated textual content rendering, which paves the best way for icon and emoji assist, in addition to considerably sooner textual content show.

Delete momentary recordsdata out of your drive

Some of the momentary recordsdata in your drive might 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 momentary person recordsdata: del /q /f /s %temp%*

Delete momentary system recordsdata (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 areas, and we lately lined a bunch of methods to unlock house on Home 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 the Home windows on-screen keyboard

Coming into osk right into a Command Prompt opens Home windows’ on-screen keyboard which helps you to click on keys along with your mouse as a substitute 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 flexibility to power purposes closed, to show a message on shutdown, and to specify the quantity of seconds you want earlier than the operation occurs. Instance: shutdown -s -t 3600 would shutdown your PC in a single hour.

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

In case your community adapter helps the function, you may configure your PC to be a wi-fi hotspot from the Command Prompt.

How one can test 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 may allow the hotspot with this command: netsh wlan set hostednetwork mode=enable ssid=YOURSSID key=YOURPASSWORD

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

You can also need to navigate via some GUI menus to allow connection sharing (we could not discover a method to do that from the Command Prompt): Go to Community and Sharing > Change adapter settings (Management PanelNetwork and InternetNetwork Connections) and you need to see the community adapters related to your PC.

Proper click on the machine that’s related to the Web (not your new hotspot if that is listed) and open Properties. Within the Sharing tab, test the field to “Allow other network users to connect through this computer’s Internet connection.”

Amongst different netsh instructions, the function can present your Wi-Fi password by getting into netsh WLAN present profile identify=YOURPROFILE key=clear (look underneath Safety settings > Key Content material).

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

Fast repair instructions for connection points

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

ipconfig /launch (Releases your at present issued native IP deal with)

ipconfig /renew (Requests a brand new native IP deal with)

ipconfig /flushdns (Resets the contents of the DNS shopper resolver cache)

For persistent points along with your connection, there are some extra elaborate instructions which can be price making an attempt. Be aware that you will have to reconfigure your community adapter and so forth. in case you have handbook settings, significantly when resetting TCP/IP and the Home 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 this stuff)

netsh int ip reset all (Removes and reinstalls TCP/IP, rewriting a pair of related registry keys)

netsh advfirewall reset (Restores the Home windows Firewall to default settings, deleting beforehand configured guidelines and so forth.)

nbtstat -r (Purges the contents of the NetBIOS identify 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)

Fast repair instructions for boot points

Are you greeted with a message that reads “reboot and select proper boot device?” or “NTLDR is missing” if you flip in your PC? The tactic under has labored for us to restore a Home windows 8 machine and must be legitimate for different editions of Home windows.

Be aware that these strains have to be entered in a Command Prompt that’s opened in a restoration setting from outdoors of your working system, akin to from a bootable USB drive with Home windows 10 set up media.

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

Though that sequence has labored for us previously, we examined this on a digital machine by deleting the system reserved partition (the place boot data is saved) and making an attempt to revive the bootable state by getting into these strains. Sadly, entry was denied for bootrec /fixboot and we could not discover a workaround, so Home windows nonetheless could not load.

Nevertheless, these bcdboot and bootsect instructions labored to get Home windows booting once more, regardless that we simply reformatted the system partition:

bcdboot C:Home windows (Recreates the system partition recordsdata with these copied from C:Home windows. Whereas this format works from inside Home windows, see the observe under about working this command from a restoration console outdoors of Home windows).

bootsect /nt60 SYS /mbr (Rewrites grasp boot code on the system partition and updates your grasp boot report)

*Be aware: If you’re making an attempt to run bcdboot C:Home windows from a restoration console outdoors of your Home windows set up (akin to from the Home windows 10 set up media), C:Home windows might be D:Home windows (your working system) whereas C: might be your system partition (the boot information). Coming into diskpart after which record vol will show drive volumes so what’s what (sort exit to shut diskpart). To run the bcdboot operation from a restoration setting, you need one thing like this command: bcdboot D:Home windows /s C:

Footnote…

Grasp Boot Document – The primary sector on the entire drive and accommodates a boot loader in addition to details about partitions on the drive.

Quantity Boot Document (aka Partition Boot Sector/System Partition in MS terminology) – The primary sector on a partition containing data to load an operation system.

Fast repair instructions for repairing Home windows

Nonetheless cannot boot into Home windows? Experiencing bluescreens or another bug? Home windows has built-in instruments to scan for and change corrupt system recordsdata:

sfc /scannow (from inside Home windows)

sfc /scannow /offbootdir=D: /offwindir=D:Home windows (from outdoors Home windows, akin to from a restoration drive)

A separate DISM command can scan the Home windows part retailer for corrupt recordsdata and robotically restore them:

DISM /On-line /Cleanup-Picture /RestoreHealth (from inside Home windows)

DISM /Picture:D: /Cleanup-Picture /RestoreHealth (from outdoors Home windows)

Encrypt, compress or backup recordsdata

Recordsdata and folders might be encrypted or compressed after which unencrypted and decompressed with fast particular person instructions for every operation — ensure you change the goal vacation spot:

Encrypt a file or folder: cipher /e C:UsersTechSpotDesktopFolder (listed here are extra cipher instructions — /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 amazing Tremendous Person thread discussing the topic the place variants of the identical command are really useful for having robocopy do primary file backups, copying recordsdata from one location to a different — however solely when modifications have been made.

Here is probably the most advised 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 /power (Generates a report in regards to the power effectivity of your system — the placement 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

A selection of old style telnet providers are nonetheless accessible, together with the flexibility to look at Star Wars Episode IV.

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

Be aware: If the command is not acknowledged, you may need to allow telnet. Search Begin or the Management Panel for “Turn Windows features on or off” and test the field subsequent to Telnet (click on Okay…).

Extra locations you may go through telnet:

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

telnet telnet.wmflabs.org (Wikimedia)

telnet rainmaker.wunderground.com (Climate 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 Purple Dragon)

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

telnet zombiemud.org 23 (Zombie MUD)

Be aware: This function was initially printed on October 2018. We have now revised some of its content material and bumped it on account of its old style nature, as half of our #ThrowbackThursday initiative.

Extra Helpful Ideas

Rundown of Should-Have Transportable Apps
How one can Encrypt Recordsdata, Folders and Drives on Home windows 10
21 Applications to Analyze and Benchmark Your Hardware
“Run as Administrator”: What Does It Imply?

.subDriveRevBot
.subDriveRevBot:hover background-color: #245996; transition: Zero.4s linear;
.subDriveRevBot a coloration: #fff; show: block; width: 100%; top: 100%;
.subDriveRevBot a:hover
.subDriveRevBot .titlerr
.subDriveRevBot .comment
.subDriveRevBot .remarknew font-weight: 500; coloration: #fea; font-family: Roboto;
.subDriveRevBot .bulll margin-bottom: 5px !necessary; padding: 15px 5px

SHARE