How To Run File Names With Spaces Through Command Line

You might wonder but there are several ways to open as well as run a file in Windows. User can easily double click on any particular file which is to be opened or the user can easily use the run command (CMD) to open or execute the file. User can also use command prompt to open any particular file. There are cases when the user have to manually enter the path as well as file name in command prompt but file doesn’t open or sometimes the program doesn’t run and the case for this can be mainly the syntax which is being used in the command prompt or there are some minor bug in our operating system which can be fixed out and solve. In the following article we will talk about command line in detail as well as how we can run file names with space through command line.

How To Run File Names With Spaces Through Command Line

Command line interface

Talking about command line interface which is mainly used for interacting with software as well as file by typing commands which helps in performing some specific task. Now talking about these command which can be acted immediately if the user is typing in a command prompt window or run dialog box which is easily present in the start menu. Talking about the commands if it is saved in a script like that of batch file (.bat) the command will be performed as soon as the scripts runs. Talking about the saved script file which allows to run task easily which are mainly repeated ones as well as they can run by task scheduler.

Run File Names With Spaces Through Command Line

Command line Syntax

When any user is using a command, then the user must know as well as use the correct syntax of any particular command. Talking about the syntax of any command is mainly the rule regarding the command that how it’s being entered and will include option will led a change of some sort in result of running any particular command.

We can simply take an example like in some cases we can simply type a command and hit the enter key from our keyboard which will display a correct result. Say that any user want to display the current time in the command prompt window the user can simply type time and press enter as a result the time will be displayed. Apart from that second line will also allow the user to enter the new time and if the user press the enter key without entering the new time the command prompt will return to its origin.

Steps for running file names with space through command line

  • Usually when a user wants to open some files in any different program (which is mainly recognize by windows) we mainly use the start command before any file path as well as file name to open that particular file which is to be opened.
  • Talking about the syntax for opening a text file is as mentioned below:
  • C:\>start sample .txt
  • By entering this we can easily open our text file but sometime when it comes to filenames mainly with spaces the window only takes the first word and search for that name which is related to that and in some cases when it is unable to find the name of the file the following error will be displayed.
  • C:\Users\nanos_000\Desktop>start sample text file
  • [Window cannot find ‘sample’. Make sure you typed the name correctly, and then try again.]
  • C:\>start “sample text file.txt”
  • But there are some cases when this syntax doesn’t work. As because there are different DOS based interpret file names which are different which causes confusion about writing the correct syntax of filename with spaces.

Also Read: Recover Data From Lost iPhone


At last but not the least I would like to conclude the topic by saying that users who often use command line should be very careful about the syntax which has to be used correctly in the command prompt and talking about the file names with space can easily be run through command line by following the above mentioned point keeping the use of correct syntax in mind. Thus in short as well as in easy language we can say that to operate command line the most important thing is the syntax.

Leave a Reply

Your email address will not be published. Required fields are marked *