Sign in with
Sign up | Sign in
Your question
Closed

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

Last response: in Windows 7
Share
December 13, 2011 5:02:05 PM

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 :) 

Best solution

December 13, 2011 5:05:02 PM

cd %appdata%\Macromedia\Flash Player\#SharedObjects
delete *.*
Share
December 13, 2011 5:07:02 PM

Best answer selected by xX_PEMDAS_Xx.
Score
0
Related resources
December 13, 2011 5:09:12 PM

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
Score
0
December 13, 2011 5:12:15 PM

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!!!!
Score
0
December 13, 2011 5:16:58 PM

slhpss said:
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!!!!



ROFL ! XD
Score
0
December 13, 2011 5:36:26 PM

Create an envar to that directory in sysdm.cpl
Score
0
a b $ Windows 7
December 13, 2011 8:46:07 PM

This topic has been closed by Nikorr.
Score
0
!