How to open a file on command prompt

by Ojo Kayode
Could there be a way to open a file on a computer using command prompt? Well the answer is yes but I will be focusing mainly on windows 7 & 8 because the method works for both.

Why do you need to open a file through that means,can't you just open it directly from the start menu. Of course you can but there are two reasons why you might need to know this.

Open a file using cmd

The first reason is for you to to be viewed as a computer geek,though not necessary right then maybe the second reason will give you a reason to be eager to find out;

If a computer is locked and you can't remember the password you used,one idea that might fly into your head will be to format it, but the question is this; will I be able to recover my saved files after formatting? The answer to that is NO.

To make things easier you can forward all the files,videos,music's ,pictures and many more using the command prompt popularly know by Windows 7 & 8 to be CMD. Can you do that? Of course you have no idea and that is one reason why you are here.

If that is what you are looking for then this is the right place for information,
Let just assume you still have access to your system (lols..) Before moving on you will need to understand two different commands which are Dir & CD

Dir : this command will open all the directories in a folder,let say you want to open a file located in new folder once you open that new folder you will see all the files. It is just the same as listing the directories contained in that folder.

CD : this function as a left click in cmd  and is a major command that can be user to open any files or even folders.

How to open a file on Command prompt application using windows 7 or 8



  • Go your start menu an type cmd in the search box to find the application,once found right click on it and select run as administrator.
  • A message will be prompted asking you whether you want to allow this program to make changes to your computer,just don't worry about that and select yes.


  • Immediately a box with a black background and main text color is white ( you can change the color if you want to) will appear, that is the command prompt window.
  • It is time we make use of those command we learnt earlier so which of the command do you think will be used to open the folders contained in the drive.
  • Don't think too far it is the DIR ,type that in and hit enter you will see a lot of folder and files being listed you will now have to open the one that contains what you want to launch.

Let say your the file you need is located in desktop and desktop is among the folder listed when you run the DIR command,then here is how to do it.
We will need to make use of the second command which is the CD. To make this run you will need to apply another command along with it. The first command seems easier but this one might be complex.

  • Type CD and the name of the folder you want to open for instance let say I want to open Computer from command prompt then I will follow this line CD SPACE COMPUTER ENTER that is all,and I will be shown all the directories contained the folder I opened.
  • Be sure to give space between CD and Computer just one space is OK if it is more than that, the command will not be executed.
That is how to open a file or folder using command prompt. Note that even after opening the files contained in the folder you can still select another file to open in that folder by following the same pattern.

I have tried it and it worked however if you are having any problem with the command feel free to ask by using comment box below and I will give you a reply within the shortest period of time.

0 comments:

Post a Comment

Please do not hesitate to leave your opinion in the comment section below.
To contact kayscitech Blog for Article Submission, News tip