Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: command line to delete folder contents

05 Aug 2012   #1

Win7 Ultimate x32
 
 
command line to delete folder contents

What line in a batch file would delete the contents of
C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\ ?
del /F /S /Q /A "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" fails, so does
del "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" /q

My System SpecsSystem Spec
.

05 Aug 2012   #2

Microsoft Windows 7 Pro 64-bit SP1
 
 

Hello,

Try:

Code:
DEL "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\"
Haven't coded BATCH in awhile, so not totally sure.

-Justin
My System SpecsSystem Spec
05 Aug 2012   #3

Win7 Ultimate x32
 
 

Thanks Justin - NO improvement
My System SpecsSystem Spec
.


05 Aug 2012   #4

Microsoft Windows 7 Pro 64-bit SP1
 
 

Okay i looked it up this time:

Code:
del "C:\Users\MyName\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*"
You had a /q in there, and there is no need for it. So give that a shot, if not, then let me know.

-Justin
My System SpecsSystem Spec
05 Aug 2012   #5

Win7 Ultimate x32
 
 

Still no better - could it be that \Temporary Internet Files\ is more stubborn than other folders ?
My System SpecsSystem Spec
05 Aug 2012   #6

W7 Pro SP1 64bit
 
 

If you open an admin cmd prompt window and type in your command - you will be told that index.dat is in use. You will even see that there are folders that will show in the cmd prompt but do not usually show in windows file explorer.
My System SpecsSystem Spec
05 Aug 2012   #7

Win7 Ultimate x32
 
 

I am not clear what the implication is from your information. Index.dat does not show as a content item in MY TIF folder.
It may be relevant to point out that there is NO difficulty opening that folder, selecting all the contents and deleting them. The problem arises when I try to use code to do it.
My System SpecsSystem Spec
05 Aug 2012   #8

W7 Pro SP1 64bit
 
 

The path that you are using is not a real path. It is one of the many places where Microsoft shows you info that is not really located in that folder structure. Also, there are real folders and files under the "TIF" folder that you do not normally see via the Windows file explorer. My suggestion is to not mess with them:

command line to delete folder contents-tif.jpg


My System SpecsSystem Spec
05 Aug 2012   #9

Win7 Ultimate x32
 
 

Thanks for that advice. My only interest in deleting the files in TIF arises from the advice I was given to do that in order to solve a problem in Windows Live Mail.
My System SpecsSystem Spec
05 Aug 2012   #10

W7 Pro SP1 64bit
 
 

you can try:

rd "C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\" /q/s

It will still fail because index.dat is in use - but the folders and and temp files should be gone.
My System SpecsSystem Spec
Reply

 command line to delete folder contents




Thread Tools



Similar help and support threads for2: command line to delete folder contents
Thread Forum
Folder - Delete from Command Prompt Tutorials
How to capture the contents of the clipboard using the command line? Software
How-to Open Any Folder From Command Line [cmd] ? General Discussion
Unable to change folder contents on remote folder in same HomeGroup Network & Sharing
Gpedit via command line Performance & Maintenance
Script or command to delete contents of Software Distribution folder? Windows Updates & Activation
Command Line General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 02:42 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33