Command Prompt Tricks

Command Prompt Tricks

Command Prompt is one of the most powerful tools in Windows; but sadly, it is also the most ignored one. Things were not always like this; but with the advent of GUI based operating systems, people started feeling that computing through command based tools was boring. This ultimately lead the command prompt into obscurity.

However, the command prompt is not useless. In fact, it can be pretty useful. This article provides some excellent tricks, secrets and hacks that will make you realize that the Windows Command Prompt is not only useful but also a tool that you should definitely give more respect to.

Watch ASCII Star Wars in Windows XP, Vista, 7 and 8

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!

There is a complete copy of Star Wars done entirely in ASCII characters that you can watch in the Windows operating system (or any OS that supports telnet). The only thing required to watch it is an internet connection; speed does not matter.

A Picture showing Star Wars in command prompt

To watch it on Windows XP, Mac OS X and Linux
  1. Go to Start, Run. (Only for Windows users)
  2. Now type "telnet towel.blinkenlights.nl" without the quotes and press Enter. Users of Mac OS X and Linux can directly execute this code in the terminal window.

On Windows 8, Windows 7 and Windows Vista

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.
If you do not need telnet anymore, you can turn it off.


Matrix Falling Code Effect - Notepad CMD (.BAT) Tricks

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

Notepad tricks
Matrix Falling Code Effect - Notepad Trick

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

3- Make Folders that you cannot delete
Are you tired of accidentally deleting important folders? Well, if you are, you can learn how to makeundeletable folders here.

Shutdown Your Computer or a Remote PC via 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. This post will show you how to do all this.

Shutdown computer with command prompt
Required
A computer running Windows (XP, Vista, 7 or 8) with the command prompt working perfectly, i.e. not disabled by a virus.

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.

Shutdown Local Machine (Your Computer)
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.

Restart your Local Computer 
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.

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

Shutdown a Remote Computer
Type "shutdown -s -m \\name of the computer" in the command prompt and press Enter. Replace \\name of the computer with the actual name of the remote computer you are trying to shutdown. As mentioned earlier, you must have administrative access to the computer you are trying to shutdown. To know if you have administrative access, press Windows key + R and then type the name of the computer and press Enter.

Note: If you don't remember the name of the remote computer, you can look for it by opening a list of all the computers you are connected to by executing "net view" in command prompt.

If you can connect to the computer, you will be asked to login with your username and password. Upon entering them, a window will display the list of all the directories available to you. This should help you know whether you can or cannot shutdown the remote computer.

Hibernate a Local Computer
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.

Shutdown your or a remote computer after a specific time
Type "shutdown -s -t 60" to shutdown your computer after 60 seconds. Upon executing this, a countdown timer displaying a warning message will be shown. This command uses the -t command switch followed by a variable (which is 60 in this case) which represents the number of seconds after which the computer will shutdown.

Display a Message containing the reason for shutdown
Type shutdown -s  -t 500 -c "I am tired. I don't want to work anymore." (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. One example :-

Skynet has become self aware. John Connor did not stop me. You can not use your PC anymore.

Stop a System 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.

5- Know your IP address, DNS Server's address and a lot more about your Internet Connection
Command Prompt can even let you know your IP address. Just type ipconfig/ all in the command prompt and press Enter. Along with your IP address and DNS servers, command prompt will also return a ton of information like your host name, primary DNS suffix, node type, whether IP Routing ,Wins Proxy, and DHCP are enabled, your network adapter's description, your physical (MAC) address etc .

6- Know if your neighbours are stealing your Wifi connection
command prompt codes
Command Prompt can let you know if someone is connected to your Local Area Connection and using it. Just follow the steps:-
1) Open your browser and visit http://192.168.1.1 or http://192.168.0.1 depending on your router.
2) Find the tab that mentions “Attached Devices” or something similar.
3) Find the computer name, IP address and MAC Address (sometimes called Physical Address or Hardware Address) of your computer using the previous trick.
4 )Compare it with those displayed by your router in Step 2. If you notice some strange devices, then your neighbour has been sneaking in on your internet connection and it is best to ensure that yourwireless network is as secure as it can be.

7- Know if someone is hacking your computer/ Trace a Hacker
Command Prompt hacks
Want to know if someone is hacking your computer? Command Prompt can help you find if someone you don't know is connected to your computer stealing private data. Just execute netstat -a and the command prompt will return a list of computers that your computer is connected to. In the results returned, Proto column gives the type of data transmission taking place (TCP or UDP) , Local address column gives the port with which your computer is connected to an external computer and the Foreign Address column gives the external computer you are connected to along with the port being used for the connection. State gives the state of the connection (whether a connection is actually established, or waiting for transmission or is “Timed Out”).

These tricks work on Windows 8, Windows 7, Windows Vista, Windows XP, Windows 2000 and all previous versions of Windows.



No comments: