Command Prompt Tricks, Hacks & Codes

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.



1-Watch ASCII version of the Star Wars Episode IV movie


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.

2- Make Folders that you cannot delete

 

 Have you ever wondered how you can make a folder which neither can be deleted nor be renamed. Well, if you have, then you have come to the right place. With this trick, you will be able to create folders in Windows which cannot be renamed or deleted.

Basic Concept
The basic concept behind this trick is the use of Keywords. Keywords are reserved words in any programming language that cannot be used as names of variables. Windows also uses certain keywords in its programming. Some of them are con, aux, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8 and lpt9.


Make Undeletable and unrenamable folders

A Test
To test this concept, make a new folder in Windows and try to give it a name same as any keyword suggested above.

Result
Windows will not rename your folder to any of the keyword given above.

Trick
So the question arises, how can we make a folder with a keyword as its name? The solution to this problem is included in Windows itself. As we know that Windows has evolved from D.O.S.(Disk Operating System), its commands can be used in Windows. You can use D.O.S. Programming in Windows to create a folder with a keyword as its name using the steps given below:-

  1. Click on Start.
  2. Click on Run. Type in "cmd" without quotes.
  3. In the Command Prompt Window that opens, type the name of the drive you wish to create your folder in the format <drive-name>: and press Enter. e.g. If you wish to create the undeletable folder in D drive, type "D:" without the quotes. Note that the folder cannot be created in the root of C:/ drive (if C: is your system drive).
  4. Type this command- "md con\" or "md lpt1\" without the quotes and press Enter. You can choose any of the keywords given above as the name of your folder.

Now Windows will create an undeletable, unrenamable folder in the drive you entered in Step 3. However the folder can be renamed to another keyword using Windows Explorer.

Deleting the Folder

Although it is not possible to manually delete the folder, you can delete the folder by typing "rd con\" or "rd lpt1\" in Step 4 instead of "md con\" or "md lpt1\".

Windows Compatibility: This works on Windows XP, Windows Vista, Windows 7 and Windows 8.

Try it yourself to create one such folder which can neither be deleted nor be renamed.

3- Shutdown your computer giving a funny reason


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.

4-Change Processors Name Permanently



A while ago on Tweak And Trick, I published an article on changing your processor name. But recently, Anil Kumar pointed out that the trick only changed the name temporarily.

After a user restarts his computer, the name reverted back to original which is obvious as each time Windows boots, it checks the connected hardware and updates the registry value automatically. So, changing the processor name using the earlier article did not had permanent effect on the processor name.

Thus, the alien processor name you had earlier again reverted back to the boring old one.


Change Processor Name Permanently

Problem: To, make the name change permanent, it was required that the user updates the Processor Name String registry key each time when Windows starts.

Solution: It is very easy to change your processor name permanently by creating a registry key and placing a shortcut to it in the windows start up folder. To do so, just follow the steps given below:-


Steps :-
1.  Open Notepad.
2.  Copy and paste the exact code given below:-

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0]
"ProcessorNameString"="My Processor name 50000MHz"
To change the processor name, edit the part of the code given in blue. Also understand that \0 in the above code should only be present if Windows store your processor name at that location. Please open Registry Editor and navigate to the above mentioned keys to check whether or not to include the \0.

3.  Click on File Menu, click on Save As and select "All Types" in Save as Type option. Save the file as ProcessorNameChange.reg or *.reg.
4.  Create a new shortcut on your desktop. Enter regedit / S "Location of the .reg file" as the location of the item. For example, enter regedit /S "C:\Processor Name.reg" if your registry file is located in the root of C:\ drive.

Processor Name

5.   Copy the created Shortcut file.
6.  Navigate to C:\Documents and Settings\All Users\Start Menu\Programs\Startup (in Windows XP) or to C:\Users\ User-Name\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup (in Windows 8, Windows 7 and Windows Vista. Also remember that AppData is a hidden folder.)  if C: is your System drive.
7.  Paste the copied file.


This registry file would now execute each time when Windows starts and the Processor Name String would be modified each time. So, even upon restarting your computer, you will see that the changed processor name is permanent.

 5-Cool Keyboard Tricks (Windows) : Make a Disco

Keyboards usually have small LEDs which indicate whether different types of locks are activated or not. Here is a trick to use the lights of your keyboard in a more creative manner in Windows.
This trick uses a simple Visual Basic Script which when activated makes your Scroll lock, Caps lock and Num lock LEDs flash in a cool rhythmic way which gives the perception of a live disco on your keyboard.
Keyboard tricks

To make your own live disco, follow the steps given below:-

1. Open Notepad.
2. Copy paste the exact code given below:-

Set wshShell =wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
wshshell.sendkeys "{NUMLOCK}"
wshshell.sendkeys "{SCROLLLOCK}"
loop
3. Save the file as Disco.vbs or "*.vbs".


Cool Keyboard Tricks

Double click on the Saved file to see the LED lights on your keyboard go crazy and make your own cool disco.

This trick has been tested on Windows XP, Windows Vista, Windows 7 and Windows 8 and found to be working perfectly.

You can disable the keyboard disco by starting Task Manager and ending the wscript.exe process.


6-Use Keyboard as Mouse [How To]

If your mouse is not working and you don't wish to wait till you get a new mouse, you would definitely like to know how you can use your keyboard as your mouse. It is easy to use your mouse as keyboard in Windows using the On Screen Keyboard utility, but it is also possible to do the reverse.

Keyboard Mouse

All you need to do is:

Windows XP Users:-
  1. Go to Control Panel.
  2. Then click on Switch to Classic View.
  3. Then Click on Accessibility Options.
  4. Then Click on the Mouse Tab.
  5. Select Use MouseKeys.
  6. Click on OK.
  7. Then activate NumberLock (by pressing the NumLk key).
  8. You should hear a beep sound.
  9. Now you can control the mouse pointer using the arrow keys on the numeric keypad.


Windows 8, Windows 7 and Vista Users:

  1. Open Ease of Access Center by clicking the Start button , clicking Control Panel, clicking Ease of Access, and then clicking Ease of Access Center.
  2. Click Make the mouse easier to use.
  3. Under Control the mouse with the keyboard, select the Turn on Mouse Keys check box.

You can also increase the acceleration and speed of your mouse movements according to your needs.

You can alternately press the Alt+Shift+Num Lock combination to instantly activate the mouse keys.


Laptop Keyboard Mouse

For laptops, this will only work if your laptop keyboard has a numeric keypad or alternative keys which you can enable by pressing the Number Lock Key or the Function key.

On my laptop, number 6 key of the numeric keypad moves the mouse pointer left, number 4 key moves the mouse pointer right, number 2 key moves it down, number 8 key moves the mouse pointer up, number 5 and + key serve as right click while the number 0 key works as left click.

 7-Useful Keyboard Shortcuts for Windows Computers 

While most of us are already aware of obvious keyboard shortcuts like “Alt+F4” and “Ctrl+C”, there are some obscure shortcuts which most of us tend to overlook. These keyboard shortcuts are not only useful for the average PC user but for advanced users as well. This article contains many such amazing keyboard shortcuts which if used properly could save a lot of time and effort. So let's get started.

Windows key+D: This shortcut is the keyboard equivalent of “Show the Desktop”. It is useful for quickly minimizing every open window when someone walks in and you are doing some private work.

Keyboard Shortcuts Windows

Ctrl+Shift+Esc: This shortcut directly starts the task manager. While Alt+Ctrl+Del used to bring up the Task Manager in Windows XP and earlier versions, in Windows 8 and Windows 7, it just brings up the lock this computer screen.

Ctrl+Click: This shortcut is useful for opening a link in a background tab. This is useful when you have to load a page without leaving the current one.

Alt+Print Screen: takes the screenshot of the current active window as opposed to just Print Screen which takes the screenshot of the entire screen.

Shift+Click for Yes to All and No to All: If you have a lot of dialog boxes asking yes and no question, just shift+click Yes or No on one to yes all or no all.

Ctrl+C on an error dialog box to copy its contents: Suppose your computer is giving an error message and you want to copy its contents to send to the support guy, what do you do? Just press Ctrl+C while the dialog box is highlighted and its contents will be copied to your clipboard.

Ctrl+T: This keyboard shortcut opens a new tab in internet browsers.

Ctrl+Shift+T: Reopens the last closed tab.

Ctrl+Shift+N: This shortcut opens a new incognito window in Google Chrome.

Ctrl+Shift+P: Opens a new private window in Mozilla Firefox.

Alt+Enter after writing the domain name in the address bar of your browser to insert .com automatically.

Shift+Enter inserts .net domain name extension.

Ctrl+W: This shortcut closes the current tab in your browser quickly.

Ctrl+Backspace: This shortcut deletes the last word you have typed. It is useful in case you typed in a wrong word and want to delete it quickly.

Ctrl+Left or Right Arrow key: This shortcut allows you to move the cursor one word at a time instead of the default one character at a time.

Ctrl++: This shortcut allows you to zoom in web pages in web browsers. Useful when text on a web page is too small to read properly. Ctrl+Scroll wheel can also zoom in documents, file thumbnails and icons in Windows 8, Windows 7 and Windows Vista.

Ctrl+-: This shortcut does the reverse of the previous shortcut.

Ctrl+0: Reset the webpage's zoom.

Windows key+M: Minimizes all the open windows.

Ctrl+L: This shortcut allows you to quickly jump to the address bar of your web browser.

Windows key+Pause/Break: Quickly open the system properties dialog box.

Ctrl+Shift+Delete: This shortcut opens the option to delete your browser's history, cookies, cache and other details that it stores while you browse the internet. This shortcut is extremely useful for the privacy conscious.

Windows Key+L: This shortcut locks your computer.

Ctrl+H: makes the history appear.

CTRL+B: Bold CTRL+U: Underline CTRL+I: Italic.

Alt+Select: This shortcut allows you to select rectangular blocks of text in Word processors, something that is not possible with simple select.

F2: Allows you to rename the selected file.

Holding Shift while inserting a device with removable storage prevents automatic run.

Ctrl+F: This keyboard shortcut opens the Find option in any program.

Ctrl+S: If you are working on a software and want to quickly save your progress, this shortcut will come in handy.

Ctrl+Home and Ctrl+End: Useful for quickly going to the top and bottom of a page.

Ctrl+P: Useful for printing the current page.

Space Bar: While viewing a web page in a browser, pressing space bar moves the page down.

Alt+Tab: Useful for quickly cycling between running applications. Press along with Shift to cycle backwards.

Ctrl+Tab: Cycle between tabs in your browser.

Ctrl+F5: Clears the cache and refreshes the current tab.

Shift+Right click: Open alternate right click options.

Alt+Double click: Open the file's properties. Alt+Enter can also be used for this.


These are some keyboard shortcuts that I found extremely useful. If you know some more useful keyboard shortcuts, do mention them in the comments.

8-How to Secure a Wireless Wi-Fi Network

With the world going wireless in every sphere of technology, the question of security has often been raised. The same is true for wireless internet networks or Wi-Fi networks with hackers and Wi-Fi intruders always looking for ways to gain access to unsecured networks. There are several reasons why you might want to protect your Wi-Fi network. Prominent among them include better privacy, reduced internet bills and faster internet speeds.This post contains few simple techniques you can use to make sure that your wireless network is as secure as it possible can be.

Protect your Wireless Internet Network

1) Encrypt your Wi-Fi Network: When you use a Wi-Fi network for accessing the internet, every piece of data you send and receive over the air can be easily snooped by anyone with the right set of tools. Packet sniffers can be used by even the most novice of users to sniff your data. This means that a hacker can not only see which websites are you accessing but also get the login details of your personal and professional accounts.

Encryption basically involves scrambling the data that is transmitted and received by you while using a wireless network. This means that even if a hacker intercepts your data transmission, (s)he will not be able to exploit the information contained within it.
Protect WiFi Internet Network

There are two encryption standards available that you can use: WEP (Wired Equivalent Privacy) and WPA (Wireless Protected Access). WEP is the older standard of encryption and can now be bypassed in a matter of minutes. WPA is relatively newer but it still has security holes. AirCrack and coWPAtty are two free tools that allow anyone to easily crack WEP and WPA encryption using bruteforce technique. WPA2 is the latest standard and is what you must use if you want the highest level of protection for your wireless network. The encryption keys used change each time a device accesses the network making WPA more difficult to hack.

The encryption used by all devices in the network must be the same for the network to work properly. Your network will only be as secure as its least secure device. Make sure all devices you use support WPA2 encryption. Use a strong encryption key. Make sure that it is longer than 10 characters and contains a mixture of capital and small letters, numbers and symbols. Do not use common words and stuff that people can guess about you as your password.

2) Replace default passwords on your router with strong passwords: The biggest mistake most wireless internet users make is not changing default passwords on their routers. Hackers utilize public databases that contain default passwords and usernames from virtually every manufacturer. This enables them to change the security settings of your router according to their needs. Using a strong password for your router ensures that hackers and miscreants cannot change your network's security settings. To change the password on your router, visit Administration settings on your router's settings page. Also, do not store passwords in browsers as they can be easily made visible.

3) Change default SSID
Your network's SSID or Service Set Identifier is the name of your wireless network. Usually, the SSID is the name of the router's manufacturer along with the model number of the router. Changing it to not display this information prevents you from giving additional information about your router to prospective hackers.

4) Do not broadcast your SSID
Hiding SSID prevents unsophisticated and inexperienced hackers and wifi intruders from determining that your network exists. Hiding your SSID is relatively easy and the option to do so is usually under basic wireless settings on your router's settings page. However, it is important to note that some devices, including those running newer versions of Windows, will show every network even if they cannot identify its name. Moreover, your network will still contain the SSID in data packets making unmasking ridiculously easy with tools like inSSIDer, Kismet and Commview for WiFi.

5) Use scary names to discourage Wi-Fi theft: If your wireless network has a name like C:\virus.exe, most people who might otherwise access your network will not for the fear of getting their devices infected. You can use your creativity to find more dangerous names for your wireless network.

6) See Connected Devices List: Almost every new router will have a page which displays the list of every device that is connected to the network. You should check this page at regular intervals to see that unknown devices are not leeching your network. When you see an unknown device, you can be certain that someone has breached your network. You can try AirSnare, a free utility which scans your network for unexpected MAC addresses and also looks into DHCP requests.
Secure Wireless Network

7) Turn off Guest networking: While most routers will have guest networking disabled by default, it always pays to see that you may not have accidentally enabled it. Guest networking allows others to access your network.

8) Enable MAC address based filtering: Media Access Control or MAC address identifies each device connected to your network. MAC address is an alphanumeric key separated by colons. Enabling MAC address based filtering allows only devices having particular MAC addresses to access your network. You need to enter the MAC address of every device you wish to allow to connect to your network on your router's settings page. This prevents unknown devices from connecting to your network even if they know your password. To find the MAC address of your computer, open command prompt and execute “ipconfig /all” without quotes.

While it may prevent inexperienced users from getting access to your network, experienced hackers and advanced users can use a wireless network analyzer like Nmap and then change the MAC address of his computer with another free tool MAC Shift.

9) Keep your firmware up to date: Router vendors regularly release firmware updates and post them on their websites. You should occasionally check the manufacturer's website to see if a new firmware update has been released. Newer routers will automatically inform you when new firmware is available.

10) Reduce wireless signal range: If you reduce the range of your wireless network, common sense tells that it will prevent hackers located at a distance from detecting your network. This has the advantage that if hackers do not know that a wireless network exists, they will not try to break into it. You can place your router at places which would block the Wi-Fi signals. While this technique is advantageous, a hacker keen on hacking into your network will just have to use a larger antenna to pick up your router's signals. Moreover, reducing the range of your wireless network might cause troubles for genuine users.

11) When not using your internet network, turn it off: This is self explanatory. If you are not using your network, turning it off saves you from giving extra time to hackers to try and hack into your wireless network. While it may be impractical to turn every device on your network off every time you are not using the network, it still is advisable to do so during extended periods of non use.

If you follow all these techniques, your Wi-Fi network will be a lot more protected and hackers will have a tough time breaking into it.

 


 

Comments