Create new directory with batch file (MKDIR not working)?

I tried using at first a combination of xcopy and del, but del kept failing.

xcopy creates directory if it doesn't yet exist.

The other option is to use MKDIR but it does not work inside a batch file?

MKDIR "C:\stuff"

Any ideas why this is not working inside .bat/.cmd file??

It works fine from a command prompt.


Try using md instead of mkdir

md "c:\stuff"

This has always worked for me.


In Windows Vista, 7, and 8, there is a feature called User Account Control. To make a new folder in just any location, you need to be running an "elevated command prompt," which is running Command Prompt as an administrator.