cmd file to delete Internet junk

C

Crios

Hi
I would like to write a cmd file that clean the temporary files (Internet
junk) for several users. The file has to:
1. search all or some of the files from "C:\Documents and
Settings\user\Local Settings\Temporary Internet Files" for several users.
2. delete the founded files

Other ideas how to delete junk for several users at once without 3rd party
software R welcome (group policy ?).

Thanx.
 
P

Pegasus \(MVP\)

Crios said:
Hi
I would like to write a cmd file that clean the temporary files (Internet
junk) for several users. The file has to:
1. search all or some of the files from "C:\Documents and
Settings\user\Local Settings\Temporary Internet Files" for several users.
2. delete the founded files

Other ideas how to delete junk for several users at once without 3rd party
software R welcome (group policy ?).

Thanx.

Here you go:
@echo off
set Accounts=Crios Pjotr James Anne
set Path1=C:\Documents and Settings\
set Path2=Local Settings\Temporary Internet Files\Content.IE5
for %%a in (%Accounts%) do call :Sub %%a
goto :eof

:Sub
set Dir=%Path1%\%1\%Path2%
if not exist "%Dir%" goto :eof
echo Processing "%Dir%"
for /F %%b in ('dir /ad /a /b "%Dir%" ^| find /v "."') do echo rd /s /q
"%Dir%\%%b"

Instructions:
1. Copy & paste these lines into your cmd/bat file.
2. Adjust Line 2 to reflect your account names.
3. Run the batch file and examine the screen output carefully.
4. Remove the word "echo" in the last line to activate the batch file.
5. Run it again.
Note that the last line is a long line. In starts with the word "for".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top