Sign in with
Sign up | Sign in
Closed

How to delete a folder's content with CMD but leave it empty

Last response: in Windows 7
Share

Is there a way to delete a folders content but leave the empty folder when done?

I'm making myself a autohotkey script, here is what i got so far.

Run, C:\path\to\chrome.exe -incagnito
WinWait. - Google Chrome
WinWaitClose ; Wait for Google Chrome to close
Run, cmd /c "ipconfig /flushdns"


This is the folder i want to delete its contents.

%appdata%\Macromedia\Flash Player\#SharedObjects directory



Thanks :) 

if you want to make the command quiet then I would recommend adding /Q before *.* which will remove the yes no prompt. You could also add /F to delete read only files and /S to delete all files in the subfolders
Related ressources

caqde said:
if you want to make the command quiet then I would recommend adding /Q before *.* which will remove the yes no prompt. You could also add /F to delete read only files and /S to delete all files in the subfolders


very true... noone wants to deal with any of those stupid prompts...

"Are you sure you want to delete win.exe?"

YES THAT'S WHY I TYPED IT MAN DON'T QUESTION ME!!!!
Ask the community
!