Discussion Locked

Name not recognized at command prompt

0 helpful
12 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a server that was set up with a directory with a space in the name. I have found out from Microsoft's site that a directory name with a space in it will not be recognized at the command prompt. You will get an error similar to "The name specified is not recognized as an internal or external command, operable program or batch file." The workaround they say is to put quotation marks around the entire filename or put a ^ before the extended character. I cannot figure out how to type this out. If the directory is actually mapped to a drive for ex: in explorer you would see - test server (M:) - How do I get to this directory at the command prompt?

12 replies

by dcraun

What is the directory for? The easy solution would be to remove or rename the directory with the blank space. If it is a system directory, it will cause you problems down the road, better off just removing it.

by duwaned

Hi. Lets take c:\program files as an example; to get to this folder from the command prompt, type everything inside the curly brackets, and press enter: {cd "c:\Program Files"}

The same would apply to a mapped network drive. The command would be:{cd "m:\Program Files"}

I hope this makes thing a bit clearer for you.

Regards.
Duwane

by ntoz

To further clairify using the previous answer, Which was a good one, just so their isnt confustion, the { or } are not used.
its simply "C:\my directory" or

CD C:\"My Directory"

Or

CD "C:\Program Files"

by sansari

Hi:

If the drive is mapped locally, I would just change to the mapped drive and then cd the directory. For example if the I: is the mapped drive:

c:\>i:
i:\>cd program files

I would also use cmd.exe instead of command.com (Microsoft Windows DOS)

by nettek

A command prompt will recognize a folder called Program Files if you type it in as
c:\progra~1

Also, if the directory resides on an NT Server, it must be shared in order to access it. You can leave the folder named as it is on the server, and provide multiple share names for it. For example, if the folder is called Program Files on the server, it can be shared as multiple names such as ProFiles and PFiles. When you access the folder from a command line, you access either of the share names.

by jakomeit

Thank you everyone. I wasn't thinking and my problem was that I was typing M:\ instead of M:. Duh. Thanks again.

This discussion is closed to new replies.