Sunday, 7 July 2013

Command Prompt Tricks/Hacks/Codes

Command Prompt Tricks/Hacks/Codes

Required
A computer running Windows (XP, Vista, 7 or 8) with the command prompt working perfectly


Initial Steps 
1) Press Windows Key + R.

2) Enter CMD and press Enter.



This will start the command prompt. Follow the instructions below depending on what you want to do.



  • How to ShutDown/Restart/Logoff/ Hibernate Your Computer Using Command Prompt

      Most of us shutdown our computers using the power button given in the Start menu. Some of us use the physical power button on our machines. Very few people actually use other means of shutting down a computer and even less is the number of people who use the command prompt to shutdown a computer.

A reason for this is that most of us don't know that the command prompt can be used to not only shutdown, restart or log off our computer instantly but also to shutdown a remote computer provided you have administrative access. It can also be used to hibernate a computer and give a comment containing the reason for shutdown.

To ShutDown
Type "shutdown -s" without the quotes in the command prompt and press Enter. Shutdown is the command being executed and the switch -s tells the computer to shutdown.

To Restart
Type "shutdown -r" in the command prompt and press Enter. In this case, the command switch -r is telling the computer to restart after shutdown.

To Log Off
Type "shutdown -l" in the command prompt and press Enter. The -l command switch tells the computer to log off.

To Hibernate
Type in "Rundll32.exe Powrprof.dll,SetSuspendState" without the quotes and press Enter. Your computer should hibernate, if it does not, then you must enable hibernation to do this.

Timed Shutdown and Message during Shutdown
Type shutdown -s  -t 500 -c "I am soo tired. I don't want to work anymore. byeeee" (with the quotes) in the Command Prompt and press Enter. The -c switch is used in the code to give the reason for shutting down and what is followed in quotes will be displayed in the dialog box as the reason. This can be used to display all sorts of funny messages.

To Stop a Shutdown
Type "shutdown -a" and press Enter. This will stop the system from shutting down if the countdown to shut down has not reached 0.

  • Watch ASCII Star Wars in Command Prompt
Every one of us has watched Star Wars on television, computer or in a theater. It is the same movie with aliens fighting each other for galaxies and such stuff. There is nothing new in it. But wait, have you watched an ASCII (American Standard Code for Information Interchange) version of Star Wars and that too in Windows using telnet? A network protocol known only to computer wizards. Well if you have not, then you must do it now!





For Windows Xp Users

Just open Command Prompt and type "telnet towel.blinkenlights.nl" without the quotes and press Enter.

For Windows 8, Windows 7 and Windows Vista Users

Telnet is turned off by default in the latest versions of Windows. So, in order to watch star wars, you must first enable telnet by going to Control Panel › Programs › Turn Windows Feature On or Off and ticking both the telnet check boxes. After doing that, follow the steps given below:-
  1. Go to Start, Search in Windows Vista and Windows 7. On Windows 8, open the main Start page.
  2. Type telnet and press Enter.
  3. In the following command prompt window, type "o" without quotes and press Enter.
  4. Now type "towel.blinkenlights.nl" without the quotes and press Enter.
  • Matrix Falling Code Effect - Notepad CMD (.Bat) Tricks
Notepad, the text editor that comes bundled in Windows is an excellent tool for text editing. But that is not the only thing for which notepad is famous. It is also famous for its tricks and hacks. Here is a roundup of some of the best and coolest tricks that you can try using Notepad.

Inspired by the movie Matrix, this falling code trick is extremely popular on social networking websites. Copy and paste the code given below in Notepad and save the file as "Matrix.bat" or *.bat. 



@echo off
color 02
:tricks
echo %random%%random%%random%%random%%random%%random%%random%%random%
goto tricks

Upon running the bat file, you will see the "Matrix falling code" effect.

Acknowledgement
I can't assure if your system crashes or some thing runs wrongly. it worked for me it is just an Experiment from my side.