Question:
what can represent a space in MS-DOS or command prompt?
loay.almusawi
2012-01-10 05:19:51 UTC
for example if you want to start a folder named 'program files' when you type: start C:\program files then an error message will appear saying there is no file or folder named C:\programs so it looks like a space cannot be understood by command prompt, any one here please know what to write?
Ten answers:
Link H
2012-01-10 05:30:47 UTC
When a long path name has embedded spaces, you can use them by enclosing them in double quotes, e.g. dir "c:\windows\program files"
norred
2016-11-02 02:29:35 UTC
Ms Dos Command Prompt
husoski
2012-01-10 06:27:37 UTC
That's not MS-DOS, but Command Prompt (aka "command line", "CMD.EXE" or just CMD). They're not the same. MS-DOS has not "start" command.



There are two things you need to know here. First, a command line argument is placed in quotes if it includes special characters like spaces, |, <, > and such. Ex:



dir "c:\program files"



You need the quotes because of the space in the folder name.



However, the START command is peculiar. It has a quirky rule that if the first argument is quoted, it represents a title string for the window it will create to run the program. So, with START you need to add a title (may be empty or blank) *before* a quoted path to the executable. Ex:



start "" "C:\Program Files\Internet Explorer\iexplore.exe"



This will start IE with a blank window title. (Which IE will promptly ignore and replace with its own title.)



PS: The proper term for the type of title above is "window caption", but the bar it is displayed in is called a "title bar". Go figure.



PPS: David has it almost right, except that MS-DOS directory names could have file extensions. They weren't used often, but they were allowed.
R T
2012-01-10 05:23:00 UTC
Spaces are understood by MS DOS. Spaces are not allowed in file names, though.



What exactly are you typing on the command line? The argument for start is another program. A Directory is not a program, therefore start C:\program files is not a valid command. Start wants to see an actual file at the end of the UNC path like Start C:\program files\filename



If you just want a window with the program files tree, enter



CD C:\Program Files

Start
brisray
2012-01-10 06:03:52 UTC
The Windows 7 command prompt understands spaces folder names for common names.



cd \program files



does work. In older versions and for non-common names in Windows 7 you need to put the name in quotes



cd "\program files"
David M
2012-01-10 05:23:26 UTC
In the olden days of computing, MS-DOS was restricted to 8 characters for directory names, and no spaces. When Windows started it had to integrate with Windows wanting to use spaces and more than 8 characters, so how it got round it was to refer to each windows directory by an 8 character name.



To cut a long story short, to reference C:/Program Files from MS-DOS, type:



c:

cd progra~1
2016-04-07 05:36:34 UTC
For the best answers, search on this site https://shorturl.im/awWRY



MS-DOS is an old operating system. Command prompt in windows is a console that allows similar interface to the MS-DOS. If you want the details then it would be easiest to tell that both are different. For more you would need to understand how the system works (what are interrupts, what is real and protected mode, how memory addressing works like, what is multi-threading, what is WinApi and how does it compare to interrupts, how does memory management works in DOS and in windows, how multiple commands can be handled by a single executable, .......)
KABIRU
2014-12-24 06:59:17 UTC
Just remember that if there are (space or spaces) in the statement e.g. TI FAMA then type it in double quotation; using the quotation marks enclosed like "TI FAMA" . Thank you.



This is my contribution as the young WIZARD.
Tech
2013-12-03 18:00:16 UTC
You can use Long Path Tool, it works greatly for such problems!
no1home2day
2012-01-10 05:25:05 UTC
You COULD use the ASCII equivalent, %20, but I would recommend you just use an underline. For example: This_is_a_long_title_using_the_underline_instead_of_spaces.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...