What's the equivalent to 'rm -rf' with Windows command?
I need to delete a whole directory (with a lot of sub directories and files) by running a command in a batch file.
I tried delete and erase, but both of them requires me to answer 'Y/N', and it doesn't seem to delete the directories if one has subdirectories or files.
What command can I use to delete a directory with subdirectories/files without whatever prompt?
windows-7
add a comment |
I need to delete a whole directory (with a lot of sub directories and files) by running a command in a batch file.
I tried delete and erase, but both of them requires me to answer 'Y/N', and it doesn't seem to delete the directories if one has subdirectories or files.
What command can I use to delete a directory with subdirectories/files without whatever prompt?
windows-7
add a comment |
I need to delete a whole directory (with a lot of sub directories and files) by running a command in a batch file.
I tried delete and erase, but both of them requires me to answer 'Y/N', and it doesn't seem to delete the directories if one has subdirectories or files.
What command can I use to delete a directory with subdirectories/files without whatever prompt?
windows-7
I need to delete a whole directory (with a lot of sub directories and files) by running a command in a batch file.
I tried delete and erase, but both of them requires me to answer 'Y/N', and it doesn't seem to delete the directories if one has subdirectories or files.
What command can I use to delete a directory with subdirectories/files without whatever prompt?
windows-7
windows-7
edited May 10 '17 at 14:37
djsmiley2k
5,12612336
5,12612336
asked Oct 28 '10 at 16:05
prosseekprosseek
2,337154970
2,337154970
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
rmdir /s /q [directory]
add a comment |
Try:
DEL /Q /S /F <FILE/DIR>
or
DELETE /Q /S /F <FILE/DIR>
add a comment |
I'm not sure if it's a valid command in the W7 CLI, but back when DOS was still DOS, it was as simple as:
deltree /y <dirname or path>
2
deltree is not supported in Win7.
– prosseek
Oct 28 '10 at 16:25
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f204406%2fwhats-the-equivalent-to-rm-rf-with-windows-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
rmdir /s /q [directory]
add a comment |
rmdir /s /q [directory]
add a comment |
rmdir /s /q [directory]
rmdir /s /q [directory]
answered Oct 28 '10 at 16:28
AndrewAndrew
37816
37816
add a comment |
add a comment |
Try:
DEL /Q /S /F <FILE/DIR>
or
DELETE /Q /S /F <FILE/DIR>
add a comment |
Try:
DEL /Q /S /F <FILE/DIR>
or
DELETE /Q /S /F <FILE/DIR>
add a comment |
Try:
DEL /Q /S /F <FILE/DIR>
or
DELETE /Q /S /F <FILE/DIR>
Try:
DEL /Q /S /F <FILE/DIR>
or
DELETE /Q /S /F <FILE/DIR>
answered Oct 28 '10 at 16:09
BloodPhiliaBloodPhilia
24.5k1474104
24.5k1474104
add a comment |
add a comment |
I'm not sure if it's a valid command in the W7 CLI, but back when DOS was still DOS, it was as simple as:
deltree /y <dirname or path>
2
deltree is not supported in Win7.
– prosseek
Oct 28 '10 at 16:25
add a comment |
I'm not sure if it's a valid command in the W7 CLI, but back when DOS was still DOS, it was as simple as:
deltree /y <dirname or path>
2
deltree is not supported in Win7.
– prosseek
Oct 28 '10 at 16:25
add a comment |
I'm not sure if it's a valid command in the W7 CLI, but back when DOS was still DOS, it was as simple as:
deltree /y <dirname or path>
I'm not sure if it's a valid command in the W7 CLI, but back when DOS was still DOS, it was as simple as:
deltree /y <dirname or path>
answered Oct 28 '10 at 16:21
Tristan RineerTristan Rineer
272
272
2
deltree is not supported in Win7.
– prosseek
Oct 28 '10 at 16:25
add a comment |
2
deltree is not supported in Win7.
– prosseek
Oct 28 '10 at 16:25
2
2
deltree is not supported in Win7.
– prosseek
Oct 28 '10 at 16:25
deltree is not supported in Win7.
– prosseek
Oct 28 '10 at 16:25
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f204406%2fwhats-the-equivalent-to-rm-rf-with-windows-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown