Creating a cleaning batch file

F

Ferrari_nr1

Hello,

I have a batch file to delete the temp internet files. But now I want to
maken one that deletes it for all the users on my computer, not only the one
of the admin.

How can I make this, this is what I already have:

@echo off

cd C:\Documents and Settings\administrator\Local Settings\Temporary Internet
Files

del *.* /s/q


How can I change the administrator in all the users?
I think has something to do with %, but I can't find it....

Thanks
 
H

Herb Martin

Something along the lines of (untested):

for /f %%a in ("dir /b /ad c:\docume~1") do @echo rd /s /q "%%a\Local
Settings\Temporary Internet Files" &&
md "%%a\Local Settings\Temporary Internet Files"

I just attempt to remove the directory and (just in case it works I) make
that directory again.
 
M

Mark V

Ferrari_nr1 wrote in
Hello,

I have a batch file to delete the temp internet files. But now I
want to maken one that deletes it for all the users on my
computer, not only the one of the admin.

How can I make this, this is what I already have:

@echo off

cd C:\Documents and Settings\administrator\Local
Settings\Temporary Internet Files

del *.* /s/q


How can I change the administrator in all the users?
I think has something to do with %, but I can't find it....

You might want to look over the information and batch files at
http://www.imilly.com/winclean.htm
although IIRC that does not address your specific question of
locating the several existing profile-name directories.
 

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