ping in CMD

Command Prompt (CMD) tricks you should know

In this graphical computer age, you don’t have to know how to use Windows DOS Commands. Almost everything can be down through interactive graphical interface on Windows. Even on several Linux based operating systems, the graphical interface has been significantly improved. There is a disconnect between how a computer operates and how the general public “thinks” the computer works.

The command prompt (command line, terminal, etc) can be described as a direct interaction between human and machinery. In this article we will discuss about some basic commands you can use on a Windows computer to generate a direct feedback from the system.

To open the Command Prompt, type “CMD” in Windows system wide search OR open Run and type “CMD” and hit enter.

Diver and directory change

To move from one driver to a completely different driver (in the following example, D to C, C to D), you should enter the assigned driver letter followed by character “:”. For example, D: when moving from any other dive to drive D.

cmd dri and cd
Drivers and Directories

To change the directory, type “cd” followed by a condition. This condition varies depend on the action:

  • if you want to move down a level, type “cd..”
  • if you want to jump to a specific folder in the same level as the current, type “cd.. \FolderName”
  • if you want to move up to a level, type “cd \FolderName\FolderName2”

Opening a file using a specific program

When you click on a file (not program), the Windows OS search for attributes assigned to the file you are trying to open. If an attribution is found, it will be opened using that program without any prompt to the user. For example, if you double click on a MS Word file, if you have MS Office installed, it will most likely open the file in Word. However, if you don’t have the program installed or you the attribution is not assigned to .doc/.docx files, it will prompt a message similar to “Choose a default program to open”. You can temporally assign an attribute by unchecking “default” program to make it open using MS Word once and once only at that instant.

With command prompt you can do this too. In order to open a file without permanently creating an attribution for a file type, you can type, “start ProgramName FileName.extention”. For example, you can open a .py python file in notepad++ as demonstrated below.

cmd open file
Opening a .py file using notepad++ program

This will be very useful if you are a programmer because you can avoid wasting time opening and closing one program at a time. Make sure the file you are trying to open is in the same directory as your command line location (in this case CPSC_217). It doesn’t matter where the program itself is loaded as long as you are in the same run time environment. (I will post a separate article on Run Time Environments specifically targeting 64-bit vs 32-bit later)

Network connection information

To access detailed network connection data, type “ipconfig” on any directory and anywhere in the command prompt. While ipconfig itself will generate the following result, there are several variables to this command.

ipconfig call in CMD
Check for network issues

Other possible variables include:

  • ipconfig /renew
  • ipconfig /release
  • ipconfig /allcompartments
  • ipconfig /all
  • …and many more!

To get more detailed information on how these commands works, type “ipconfig help”.

I ping you and you ping me

No, it’s not a game. In fact it is a valuable tool for network diagnosis on both LAN and WAN levels. You can test http, ftp or any other remote connection. You can also test the responsiveness of the internal LAN devices such as routers, switches, computers, game consoles, etc. Usually test a known website that has the ping connection open such as for testing your Internet connection.

ping in CMD
Testing connection quality and speeds.

Longer the ping time, lower the communication speed. You may also get a ping reject which can be translated into two things. First, it can be caused by a blocking of ping request by the responding device. Second, it can be an indication of a network device or connection failure. A very useful tool if you want to test your home servers!

I will post more tricks in the next week’s post. Stay tuned….