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
Sebastian42

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
HonorGamer

Windows 8.1 Pro x64
 
 

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
Sebastian42

Win7 Ultimate x32
 
 

Thanks Justin - NO improvement
My System SpecsSystem Spec
.


05 Aug 2012   #4
HonorGamer

Windows 8.1 Pro x64
 
 

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
Sebastian42

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
UsernameIssues

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
Sebastian42

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
UsernameIssues

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:

-tif.jpg


My System SpecsSystem Spec
05 Aug 2012   #9
Sebastian42

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
UsernameIssues

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
Thread Forum
Folder - Delete from Command Prompt
How to Delete a Folder in Windows from the Command Prompt This will show you how to permanently delete a Folder in Vista, Windows 7, or Windows 8 using the RD or RMDIR command from within a command prompt. This can be handy if you cannot delete the folder using the normal methods. ...
Tutorials
Opening desktop folder from command line
I have a desktop folder that contains all of the objects related to my internet access that is arraged in a specific way. When I click on it from the desktop, the arrangement is shown propeerly. However, if I try to open it from the command line, the arrangement is lost and everything is...
General Discussion
Command Line - Help
Hi Guy's and Girls, Just first off I've never been too good with CMD and only an Apprentice in my company I work for. Now something I've wanted to do for awhile was to make the following but I don't necassirealy I know how to do this in one batch file: I would need a Batch file that is...
General Discussion
How to capture the contents of the clipboard using the command line?
There are lots of sites discussing how to redirect the output of the command line to the clipboard but nothing covering the opposite. I want to capture a link address I have copied to my clipboard and send it to a command line program, as a variable, in a script. Clip.exe seems to be the only...
Software
How-to Open Any Folder From Command Line [cmd] ?
Example ProgramData or Any Hinden Folder. Sometime I Don't Need Check Show Hidden Files In Folder Option PS. Please Post All Command Line For Me. I Need All Command
General Discussion
Script or command to delete contents of Software Distribution folder?
Hi all. Anyone able to suggest a vbs (or command-line file) to clean out C:\Windows\Software Distribution\Download? Thanks, I'm aware of the significance (or lack of) of this folder, and I realize I could just drill down to it and manually dump the contents. I'm just looking for a more elegant...
Windows Updates & Activation

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 07:13.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App