Referencing names with spaces at command level

  • Thread starter Thread starter Laurel
  • Start date Start date
L

Laurel

How can I reference a folder that has spaces in the name when I am in a
"command" (dos) window? Here's what I've tried, and the errors I've
received:

cd "dev jics" Parameter format not correct - "dev
cd 'dev jics' Too many parameters - jics'
cd 'dev jics Too many parameters - jics
cd "dev jics Parameter format not correct - "dev
cd 'c:\dev jics Too many parameters - jics
cd 'c:\dev jics' Too many parameters - jics
cd c:\dev~1 Invalid directory
 
Laurel said:
How can I reference a folder that has spaces in the name when I am in a
"command" (dos) window? Here's what I've tried, and the errors I've
received:

cd "dev jics" Parameter format not correct - "dev
cd 'dev jics' Too many parameters - jics'
cd 'dev jics Too many parameters - jics
cd "dev jics Parameter format not correct - "dev
cd 'c:\dev jics Too many parameters - jics
cd 'c:\dev jics' Too many parameters - jics
cd c:\dev~1 Invalid directory

The correct syntaxes are:
cd "dev jics" or
cd "\dev jics" or
cd "c:\dev jics" or
cd dev jics

The error messages you quote make no sense - WinXP
does not generate them with the parameters you used.
Either you're not using WinXP or else your machine has
a serious problem with the Command Prompt.
 
Under DOS folders are directories. File names follow the 8.3 naming
convention. Your best option may be to rename the file in Windows to
something DOS can understand, and then rename it again when you are
finished.

The correct way to access to access the folder and then the file would be:

1.At C:\ type CD(spacebar) Folder Name Press Enter.
You should see C:\ <Folder Name> At this point I would type 'DIR'.Press
Enter. This will list all the files in the folder with their DOS eqivalent
file names. They fly by fast, so hit the Pause /Break button to stop the
list.

2. Once you find the file you want, at C:\<Folder Name> type the DOS name of
the file you want.

3. Keep in mind that although you may be able to list Windows folders and
files in DOS, you may not be able to display the data in the file in DOS, if
the data is a file type DOS doesn't understand.

4. If you're still having trouble, I would search the Internet for DOS
commands.

Good Luck
 
This reply is a little misleading -see below.

DandyDon said:
Under DOS folders are directories. File names follow the 8.3 naming
convention. Your best option may be to rename the file in Windows to
something DOS can understand, and then rename it again when you are
finished.

*** DOS is an obsolete operating system. Do you mean
*** the Command Prompt when you write "DOS"?
The correct way to access to access the folder and then the file would be:

1.At C:\ type CD(spacebar) Folder Name Press Enter.
You should see C:\ <Folder Name> At this point I would type 'DIR'.Press
Enter. This will list all the files in the folder with their DOS eqivalent
file names. They fly by fast, so hit the Pause /Break button to stop the
list.

*** The "DOS equivalent file names" are, in fact, identical
*** to the names seen in Windows.
*** On current PCs they fly past so fast that pressing
*** the Pause button is useless. The appropriate way
*** is to type
*** dir | more {Enter}
2. Once you find the file you want, at C:\<Folder Name> type the DOS name of
the file you want.

*** . . . and surround that name with double quotes if it
*** happens to have embedded spaces.
3. Keep in mind that although you may be able to list Windows folders and
files in DOS, you may not be able to display the data in the file in DOS, if
the data is a file type DOS doesn't understand.

*** What tool would you use to display the data
*** in "DOS"?
*** What type of data can "DOS" not understand?
 
In case someone else searches this newsgroup, I finally found the answer.
In Windows 2000 and Windows XP, you need to run cmd.exe in order to handle
spaces and long names. The default "command" in these later OSs do not
handle quotes around file names to deal with spaces.
 
I see. Please note that "command.com" is NOT the
default command processor in Win2000/WinXP
but cmd.exe is. In its default installation Win2000/XP
gives you several "Command Prompt" shortcuts and
each of these uses cmd.exe. I suspect you changed
them to "command.com", and suffered as a result!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top