8

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.

  • 1
    What error do you get? – Paul Jul 26 '13 at 3:13
  • Provide real example so we can reproduce the problem. – Vlastimil Ovčáčík Jul 26 '13 at 6:13
17

Try using md instead of mkdir

md "c:\stuff"

This has always worked for me.

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.