USEFUL CMD TRICKS

1.Get help on almost every Command

command-prompt-tricks (1)

Simply type ‘/?‘ at the end of the command you want the info.

e.g. attrib/?

2.Useful Function Keys

You can use function keys in command prompt.

Uses are:

  • F1: Pastes per character last used command
  • F2: Pastes last used command only to a specified command character
  • F3: Pastes Last used command
  • F4: Delete command only to a specified command character
  • F5: Pastes last used command without cycling
  • F6: Pastes ^Z
  • F7: Provides a list of already used commands (selectable)
  • F:8 Pastes cycleable used commands
  • F9: Will let you paste command from the list of recently used commands

3.Copy Data from Command Prompt

You can copy data from command prompt simply by following these steps:

1.Right Click in cmd window.

2.Select mark.

command-prompt-tricks (3)

3.Mark using  left click.

4.Copy using Enter.

You can enter the copied data anywhere.

4.Save a command in file

command-prompt-tricks (2)

You can save a command in a file for future reference.

Just add “> (destination/file name with .txt extension)

e.g. “ipconfig > c:\Networkdetails.txt

This command will create a .txt file in C drive with name “Networkdetails”.

5.Check IP address of any Website

Simply write “nslookup website” .

e.g. nslookup  rajat6397.wordpress.com

6.Use Multiple Commands

command-prompt-tricks (6)

Simply add both commands with ‘&&’.

e.g. ipconfig && dir

7.Get PC drivers’ list

command-prompt-tricks (8)

you cansee all the drivers installed in your PC along with, Name, Type and Link date just by one command “drivequery“.

8.Check Default Programs

command-prompt-tricks (7)

You can check which applications are used to open which type of programmes.

Just you need to type “assoc“.

9.Change colors

command-prompt-tricks (10)

  • Right Click on the top.
  • Select Properties.
  • Select Colors.

10.Make undelete-able Folders

command-prompt-tricks (11)

  • Type drive name(other than drive where windows is installed ) .
  • Type “md con\” or “md lpt1\
  • To delete: replace “md con\” with “rd con\” or “md lpt1\” with “rd lpt1\”.

11.Get Network Details

command-prompt-tricks (12)

  • Type “ipconfig” and press Enter.

12.Hide Files and Folders

command-prompt-tricks (13)

  1. Type drive name where folder is located.
  2. Enter  “Attrib +h +s +r”.
  3. Enter name of file or folder you want to hide.
  • e.g.  “D: Attrib +h +s +r rajat

13.Compare two files

type “fc C:\rajat\sample1.txt C:\rajat\sample2.txt” and hit enter to get comparison of both files with answer such as, files are different or both files are identical.

14.Create Wi-Fi Hotspot using Command Prompt

CMD tricks 18

You can easily create WiFi hotspot by following these steps:

  1. Type:“netsh wlan set hostednetwork mode=allow ssid=Hotspotname key=password
  2. To Start Type: “netsh wlan start hostednetwork
  3. To Stop Type: “netsh wlan stop hostednetwork
  4. Go to :“Control Panel>Network and Sharing>Change adaptor settings
  5. right click on the internet connection you are using
  6. Click Properties
  7. Go to Sharing.
  8. Check the option :“Allow other network users to connect through this computer’s internet connection”.

15.Shut Down Computer With Commands

  • Shut down: shutdown -s
  • Restart: shutdown -r
  • Log Off: shutdown -l

16.Shutdown Computer In specified Time

  • Type shutdown -s -t (time in seconds)
  • e.g.shutdown -s -t 120  

17.Print Message Before Shut Down

  • Type : shutdown -s -t 500 -c “I am going to sleep”

18.Hide a folder

  • Type: attrib +s +h Drive: filename 

19.Unhide a folder

  • Type : attrib -s -h Drive:filename

20.Netstat CMD Command

Netstat command is an important tool when you want to know about who is establishing a connection with your computer. The out of this command provide you the information about all active connection and listening ports.

You can use the Netstat command with following attributes

1. -a (display all connection).

2. -n (sorts connection in numerical order).

3. -b (display executable name. that is browser name).

netstat cmd command

These CMD tricks will definitely help you understand Command Prompt in a better way. If you happen to know some other trick which is worthy of a mention in the post, let us know in comments section.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s