You are not logged in.

#1 06 Jan 2006 16:37

N.ISSA
Member
Registered: 06 Jan 2006
Posts: 3

looking for opinions

I am trying to do a script that takes care of all temp files on xp/2000/2003 machines
and this my first attempt.

@ECHO OFF
CD \
FOR /F "TOKENS=*" %%G IN ('DIR /A:D /S /B TEMP') DO (
ECHO %%G
CD %%G
ECHO  REPLACE THIS ECHO WITH "DEL *.* /F /S /Q | FIND "X3Z""
)
CD \
ECHO Done with temp files.
FOR /F "TOKENS=*" %%G IN ('DIR /A:D /S /B "TEMPORARY INTERNET FILES"') DO (
ECHO %%G
CD %%G
ECHO  REPLACE THIS ECHO WITH "DEL *.* /F /S /Q | FIND "X3Z""
)
CD \
ECHO Done with temporary internet files.


There is some cleaning that can take place in this script.  But thats not what I am looking for I just want to see if there may be a better method to do what I  am trying to do.  No I don't want to use the "cleanmgr"  (that crap is to slow).

DEL /F /S /Q %TEMP%

Is not an option because this doesn't hit all users.  It only does the current user.

Last edited by N.ISSA (06 Jan 2006 16:51)

Offline

#2 06 Jan 2006 19:56

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: looking for opinions

How are you planning to run the script?
If it's via login script the users will (or should) only have rights to delete their own files. If it's via policy you need to ensure none of the files are in use at the time the script runs.

Offline

#3 06 Jan 2006 23:27

N.ISSA
Member
Registered: 06 Jan 2006
Posts: 3

Re: looking for opinions

I plan on running on my customer computers before my other scans.  So pretty much they are offline. And they wont have any access to this script.  Basically it is a pre clean before I dive into virus and spyware scans. So I am not scanning trash files.  Hence a faster scan.

Last edited by N.ISSA (06 Jan 2006 23:28)

Offline

#4 11 Jan 2006 19:57

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: looking for opinions

To delete the TIF files you will need something like this (for IE 5)

CD "%userprofile%\Temporary Internet Files\
DIR /A:D
CD "%userprofile%\Temporary Internet Files\Content.IE5"
DEL index.dat

If the .dat file is locked, either reboot or see the advice on http://ss64.com/nt/del.html

Alternatively you should be able to speed up cleanmgr by choosing just the options you need
http://ss64.com/nt/cleanmgr.html

Offline

Board footer

Powered by