Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



TheTOM_SK

Batch file to remove files & folders?

Recommended Posts

add a pause to the CMD script, and enclose the folder in quotes, also remove the /q so you can see any possible errors:

RD /S "C:\New Folder"
pause

Share this post


Link to post
Share on other sites

Awesome, it works now. Thank you for your great help. thumbup.gif

ECHO Y | RD /s "C:\New Folder"
ECHO Y | RD /s "C:\New Folder (2)"
ECHO Y | erase C:\File.txt

Share this post


Link to post
Share on other sites

if you put the /q back in then you can eliminate the "echo y |" most likely problem was because of the space in the path. the /q will bypass the confirmation.

Share this post


Link to post
Share on other sites

Yeah, you are right, thanks. Finally I can do as many clean instalations as I want. :D

rd /s/q "C:\New Folder"
rd /s/q "C:\New Folder (2)"
erase "C:\New Text Document.txt"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×