What is the command to create/delete a folder/folders in a batch file? CREATE TOO.
Asked
Active
Viewed 1,286 times
-2
-
possible duplicate of [How to delete files/subfolders in a specific directory at command prompt in Windows](http://stackoverflow.com/questions/1965787/how-to-delete-files-subfolders-in-a-specific-directory-at-command-prompt-in-wind) (and this one is close enough for the create part http://stackoverflow.com/questions/4165387/create-folder-with-batch-but-only-if-it-doesnt-already-exist) – indiv May 09 '15 at 03:08
-
This question is very simple, you should have done some researching online instead of asking here. – Kit May 18 '15 at 17:35
1 Answers
0
RD /S /Q "C:\SomeFolder"
by default RD
can delete only empty folders ,so for robustness you need S and Q switches.
To create folder:
MD "C:\SomeFolder"
MD is capable to create also subdirectories.

npocmaka
- 55,367
- 18
- 148
- 187
-
What possible value could this question have for future readers that would cause you to post an answer to it instead of closing it? It's very poor quality, shows zero effort to find a solution before posting, and doesn't even contain full sentences or real words. – Ken White May 08 '15 at 18:16
-
@KenWhite - agree.Just my first impulse when I see a question is to answer if I can – npocmaka May 08 '15 at 18:19
-
Your first impulse should be to exercise your responsibilities as a 10K+ user and use the moderator tools you have to keep the garbage off the site. :-) Closing this type of question also serves as an educational guide to the user that posted it, instead of encouraging more low-quality questions in the future. – Ken White May 08 '15 at 18:20
-