Page 1 of 1

Make Directory with space

Posted: 11 Apr 2011 12:26
by atamo
Hy

I need to copy some file in a subfolder of Program Files ,but because Program Files contain a space can't create the directory.

Code: Select all

md c:\Program Files\ProgramName

 or

md %ProgramFiles%\ProgramName


Create a new folder with Program's name but I need to make a directory in Program Files :?

Any ideea ???

Re: Make Directory with space

Posted: 11 Apr 2011 12:34
by !k
cmd/? wrote:The special characters that require quotes are:
<space>
&()[]{}^=;!'+,`~

Re: Make Directory with space

Posted: 11 Apr 2011 12:48
by atamo
Thank's , I forget it..... :oops:


but

Code: Select all

MD %programfiles%\Folder

why don't work ?

Re: Make Directory with space

Posted: 11 Apr 2011 13:29
by aGerman
Because %programfiles% expands to the real path. It could contain something like C:\Program Files and as you can see there is a space again.

Try

Code: Select all

MD "%programfiles%\Folder"

as suggested before.

Regards
aGerman

Re: Make Directory with space

Posted: 11 Apr 2011 13:41
by atamo
you're right, thanks for detailed explanation , :mrgreen:

Re: Make Directory with space

Posted: 29 Apr 2011 13:50
by scienceguru1.bat
is there a way to do this with the %date% variable used? i didn't have any luck with it.

Re: Make Directory with space

Posted: 29 Apr 2011 20:35
by !k
md "%date:/= %"
/ is your delimiter in date format
also : and \ not allowed in names