10 Command Prompt Hacking Tips
If you are a windows user then you might have used windows command prompt. Sometimes it makes out work lot more easier by simply running a command. In this article we have got 10 Command Prompt Hacking Tips for you which will make your black and white command prompt look cool.
Changing the color of Command prompt
By default the the color of command prompt is back and white. This looks dull and boring at times. You can change the color of your command prompt. First you have to run below command. Then you can change the color based on the given numeric or alpha numeric combination.
Color <attribute>
C:\>help color
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
Sets the default console foreground and background colors. COLOR [attr] attr Specifies color attribute of console output Color attributes are specified by TWO hex digits -- the first corresponds to the background; the second the foreground. Each digit can be any of the following values: 0 = Black 8 = Gray 1 = Blue 9 = Light Blue 2 = Green A = Light Green 3 = Aqua B = Light Aqua 4 = Red C = Light Red 5 = Purple D = Light Purple 6 = Yellow E = Light Yellow 7 = White F = Bright White If no argument is given, this command restores the color to what it was when CMD.EXE started. This value either comes from the current console window, the /T command line switch or from the DefaultColor registry value. The COLOR command sets ERRORLEVEL to 1 if an attempt is made to execute the COLOR command with a foreground and background color that are the same. Example: "COLOR fc" produces light red on bright white |
Changing the prompt
This is another cool hack to modify your regular prompt and customize it. This can be done by executing the below command.
help prompt
Once you execute this command you will get below details on how to customize your command prompt. To execute and change the prompt just run the below command
prompt <your custom prompt>
C:\>help prompt
Changes the cmd.exe command prompt.
PROMPT [text]
text Specifies a new command prompt.
Prompt can be made up of normal characters and the following special codes:
$A & (Ampersand)
$B | (pipe)
$C ( (Left parenthesis)
$D Current date
$E Escape code (ASCII code 27)
$F ) (Right parenthesis)
$G > (greater-than sign)
$H Backspace (erases previous character)
$L < (less-than sign)
$N Current drive
$P Current drive and path
$Q = (equal sign)
$S (space)
$T Current time
$V Windows version number
$_ Carriage return and linefeed
$$ $ (dollar sign)
If Command Extensions are enabled the PROMPT command supports
the following additional formatting characters:
$+ zero or more plus sign (+) characters depending upon the
depth of the PUSHD directory stack, one character for each
level pushed.
$M Displays the remote name associated with the current drive
letter or the empty string if current drive is not a network
drive.
Changing the title of command prompt box
This hack will change the title of your existing command prompt box. You can enter the text you want keep as title.
Title [TEXT]
Encrypting the files using CMD
It is the most useful command to encrypt or decrypt the folders or files without using any third-party apps.
Open CMD
Just type ” Cipher /E” then hit on enter this will encrypt all the files in the current directory.
To decrypt type “Cipher /D”.
Hiding files and folders using command prompt
This command helps you to hide file and folders using command prompt. You can use below commands to hide any file and folder.
attrib +h +s +r <foldername>
To show the folder excute the below command.
attrib -h -s -r <foldername>
Copying command output to clipboard
Whenever you run any command in command prompt you get the output displayed in the same command prompt. Now using this command along with you actual command you will get the output directly copied to your clipboard. You can open an empty notepad and paste this output data there and save it.
ipconfig | clip
C:\>ipconfig | clip
Command to get list of installed programs
This is command is useful to get the list of installed applications on your computer. It is helpful and useful for getting these data in one click.
wmic product get name
Check the Computer battery Details in CMD
This command will provide you the details about your pc battery. After executing the command, it will generate a report in HTML format. Before execution of this command, open the command prompt with admin privilege. The report will be generated in “C:\WINDOWS\SYSTEM32 folder with a name energy-report.html”
powercfg -energy
Check Command prompt History
To check what are the commands which are executed on command prompt, there are two methods to do it.
- Doskey /history – It will show the data in the same command prompt.
- press F7 – This will open a separate window and show the previous executed commands.
Shutdown or Restart Another Computer
If you want to trigger and shutdown or restart for multiple remote computers then this is a good useful tool. You can run the below command to open a GUI based inbuilt tool. Just add the host names select the option to restart or shutdown the servers and trigger it.
shutdown -i
Must Read: