10 Cool Command Prompt Tricks You Should Know | Cool CMD Tricks | star wars cmd code
01. Hack the Prompt Text
Did you know that the prompt itself in the Command Prompt is completely customizable thanks to the prompt command? It is, and when I say customizable, I mean really customizable.
Instead of C:\>, you can set the prompt to any text you want, have it include the time, the current drive, the Windows version number (like in this example image), you name it.
One useful example is prompt $m$p$g, which will show the full path of a mapped drive in the prompt, alongside the drive letter.
You can always execute prompt alone, without options, to return it to its sometimes boring default.
02. Get Help for Any Command
Believe it or not, the help command does not provide help for every Command Prompt command. (How silly is that?)
However, any command can be suffixed with the /? option, usually called the help switch, to display detailed information about the command's syntax and often times even some examples.
I doubt that the help switch is the coolest Command Prompt trick you've ever heard of, but it's hard to disagree that it's one of the more useful.
Unfortunately, neither the help command nor the help switch offer much in the way of explaining how to interpret the syntax. See How to Read Command Syntax if you need help with that.
03. Save a Command's Output to a File
An incredibly useful Command Prompt trick is the use of redirection operators, specifically the > and >> operators.
These little characters let you redirect the output of a command to a file, giving you a saved version of whatever data the command produced in the Command Prompt window.
For example, let's say you're about to post a computer problem to an online forumand you want to provide really accurate information about your computer. An easy way to do that would be to use the systeminfo command with a redirection operator.
For example, you might execute systeminfo > c:\mycomputerinfo.txt to save the information provided by the systeminfo command to that file. You could then attach the file to your forum post.
See How to Redirect Command Output to a File for more examples and a better explanation of how to use redirection operators.
04. View a Drive's Entire Directory Structure
I think one of the neatest little commands is the tree command. With tree, you can create a kind of map of the directories on any of your computer's drives.
Execute tree from any directory to see the folder structure under that directory.
With so much information created with this command, it's probably a good idea to export the results of tree to a file so you can actually look through it.
For example, tree /a > c:\export.txt, just as explained in the last Command Prompt trick about redirection operators.
05. Customize the Command Prompt Title Bar Text
Tired of that Command Prompt title bar text? No problem, just use the title command to hack it to say whatever you like.
For example, let's say your name is Maria Smith, and you want to express your ownership of the Command Prompt: execute title Property of Maria Smith and the Command Prompt's title bar will change immediately.
The change won't stick, so the next time you open Command Prompt the title bar will be back to normal.
The title command is usually used to help give a custom appearance in script files and batch files... not that I'm saying titling it with your name isn't a good idea!
06. Open the Command Prompt From Any Location
10 Cool Command Prompt Tricks You Should Know
Reviewed by Tecnology Funky
on
November 01, 2017
Rating:
No comments: