Batch File Delete "Temporary Internet Files" Vista

Looking for some help coding a batch file that will delete the tempora

Page 1 of 1

1 Replies - 8336 Views - Last Post: 16 January 2009 - 02:06 PM Rate Topic: -----

#1 Digital-goliath   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-January 09

Batch File Delete "Temporary Internet Files" Vista

Post icon  Posted 16 January 2009 - 12:19 PM

Hello Everyone,

Recently I've been working on a multifunctional batch file that will make deleting, reformatting, cleaning, transferring, and locating files quickly. Anyways one of my function in the file is to Delete "Temporary Internet Files" and Temp files from my computer. I have came up with the following code which is somewhat successful.

echo Deleting Files
Del /F /S /Y C:\Users\%Username%\AppData\Local\Microsoft\Windows\Temporary Internet Files\
DEl /F /S /Y %TEMP%
echo Complete

Note this is just Part of my code not the whole thing.

So anyways when it goes to delete the "Temporary Internet Files" it says "The system could not find the file specified" Then I tested maybe I Had the %username% input variable wrong so I skipped that and just put my User name in their and it still didn't work, I think this may be due to the fact that the file in the folder "Temporary Internet Files" are hidden and so is Appdata which is like the fourth parent to that file.

So anyways my question is. Is there anyone to access those folders with another batch file command or maybe something like I did for TEMP, also is there a way to override the Hidden folder so it deletes them anyways, and finally if you could help me out on this one is their any other TEMP folders or files that could be deleted and remember I"m using vista so the directories may be different if you not using Vista.

And please don't just tell me "Oh you could easily do this with CCleaner" I'am well aware that CCleaner is a great free application that can do a lot of this but I really what to create this myself.

Is This A Good Question/Topic? 0
  • +

Replies To: Batch File Delete "Temporary Internet Files" Vista

#2 gabehabe   User is offline

  • GabehabeSwamp
  • member icon

Reputation: 1433
  • View blog
  • Posts: 11,006
  • Joined: 06-February 08

Re: Batch File Delete "Temporary Internet Files" Vista

Posted 16 January 2009 - 02:06 PM

It seems that you're on the right path. The only thing you don't really need is the bit before that on your path. All you really need is this:

%AppData%\Local\Microsoft\Windows\Temporary Internet Files

Forgive me if I'm wrong, I rarely touch on batch any more. Let me know and I'll look into it further. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1