Creating a cleaning batch file

  • Thread starter Thread starter Ferrari_nr1
  • Start date Start date
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
 
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.
 
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.
 
Back
Top