We help IT Professionals succeed at work.

create a directory which name contains spaces

abitoun
abitoun asked
on
Hi I am trying to create a batch file that would create a directory named Advanced Users, i know we can not use spaces but i am sure there is a way to bypass that, any ideas?
I am using
md "advanced users"
Thank you
Comment
Watch Question

md "c:\yourpath\named users"
use quotes
sorry advanced not named
insert the quotes around the path
md "c:\yourpath\advanced users"
Commented:
What exactly is not working or what kind of error is it giving you? I tried to duplicate your issue and it works fine for me.
Steve KnightIT Consultancy
CERTIFIED EXPERT

Commented:
If you do

c:
cd \
md test
cd \test
md a long name with spaces in

You end up with

c:\test\a
c:\test\long
c:\test\name
c:\test\with
etc.

i.e. unless you add the quotes as suggested it will create each dir listed on the line.

I imagine that this is what the requestor was finding was happening

Steve

Commented:
Well he included  quotes around the dir when he posted his question so I'm not sure about that.

Author

Commented:
Hi, Thank you to all that responded, I was missing a double quote!
i dont understand how the point were allocated here was there a problem or was I just wasting my time

Commented:

If the OS is MSDOS with an LFN driver then ...
md advanced_users
then use a HEX disk editor, such as NORTON DISK DOCTOR to replace the
"_" with  " "

Probably not what you wanted.

What is the OS?

Steve....

Explore More ContentExplore courses, solutions, and other research materials related to this topic.