Im trying to create a batch file to remove a directory in Windows XP, obviously it asks whether you want to delete the directory yes or no, but i want it to delete automatically without it prompting me everytime for the yes/no, i have tried many switches like DEL /y & DEL | Y & a few more but none work for XP , is there anyway to get round this?

Recommended Answers

All 2 Replies

Hi,
You can use the rd command. Syntax is as follows:-
rd /s /q foldername

/s => Delete all files and subfolders in addition to the folder itself.
/q => Quiet - do not display Y/N confirmation. Assumes "Yes" as answer.

More info:-
http://www.ss64.com/nt/rd.html


By the way, in Windows 98/ME, you can use deltree command. Syntax is as follows:-
deltree/y foldername
/y => Do not display Y/N confirmation. Assumes "Yes" as answer.

Thanks for the tip, works perect!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.