I have a very simple query. I have a folder "x" on my desktop (Windows 7), and I want to write a Batch Program to delete all files in it. (all extensions) This is what I've come up with:
cd c:\users\admin\desktop\x\
del *.*
but, when I open it, the console still asks for Human input (Y/N). What can I do to bypass this?
Always use the explicit path so a flaw does not delete the current folder, whatever that may be at the time.
All visible files, silently
del "c:\users\admin\desktop\x\*.*?"
All visible files, silently using /q
del /q "c:\users\admin\desktop\x\*.*"
All visible files, including subdirectories, silently
del /s /q "c:\users\admin\desktop\x\*.*"
type del /?
for full info.
It's dangerous, but
del *?*
or
del ?*?
should delete as required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With