Jump to content

cleanup temp in profiles


Recommended Posts

Hi, here a chance for someone to show their skills and for me to show my ignorance in this domain. I guess it would be pretty easy if you know that stuff. How do you make a script that empties those two folders "\Local Settings\Temp" and "\Local Settings\Temporary Internet Files" for all profiles and without confirmation deleting system files ?

Profiles would be in D\:Data\

So for instance D:\data\Ponch\Local Settings\Temporary Internet Files

I have PCs with more than 20 profiles. THANKS ! I did search a bit.

Link to comment
Share on other sites


It's not an easy task at all, and one which I'll never provide my best code for, there are literally thousands of people looking for good scripts for this and to be honest I'm not willing to provide it freely. It is one of only a few tasks that I decided many years ago not to give freely.

There are some very poor NT command, visual basic and java scripts available across the web most of them with a cost thats not worth paying. There are also built-in tools for emptying TIFs and hundreds of free/payware cleanup utilities for both tasks.

If you want to try to create your own then I'd suggest VBScript or JScript, and bear in mind that index.dat files should only be removed if a reboot is built in to the scripted process.

Good Luck!

Link to comment
Share on other sites

  • 3 weeks later...
Hi, here a chance for someone to show their skills and for me to show my ignorance in this domain. I guess it would be pretty easy if you know that stuff. How do you make a script that empties those two folders "\Local Settings\Temp" and "\Local Settings\Temporary Internet Files" for all profiles and without confirmation deleting system files ?

Profiles would be in D\:Data\

So for instance D:\data\Ponch\Local Settings\Temporary Internet Files

I have PCs with more than 20 profiles. THANKS ! I did search a bit.

ICSWEEP V2.0 is a command-line utility to clear the Temporary Internet Files

Cache and/or the TEMP files folder of ALL user profiles that are NOT in use

when this command is executed. This utility was written for the purpose of

allowing a SINGLE command to identify and clear Temporary Internet Files

Cache and/ or TEMP files of ALL user profiles currently NOT in use.

This tool could be simply run from the command line at any time, or added

as a SCHEDULED TASK for regular cleaning of user profiles, reducing the

overall size of a profile and saving disk space for locally based profiles.

ICSWEEP will only function when executed by a user with ADMIN rights to the

profile directory.

Usage:

ICSweep [/ALL|/TIF|/TMP] [/?]

/ALL - Delete both Temporary Internet Files and Temp files

/TIF - Delete Temporary Internet Files only (Default)

/TMP - Delete Temp files only

/? - show this help file

ICSWEEP without parameters will execute the /TIF switch by default.

The program returns a running list of the processed profiles. To store the

output run the following command: ICSWEEP.EXE>ICSWEEP.txt

This utility is FREEWARE and was written by Warren Simondson of

Ctrl-Alt-Del IT Consultancy, Australia. www.ctrl-alt-del.com.au

Although written for Terminal Server and Citrix environments, this application

will function on non-TS/Citrix workstations and servers.

This application has been tested on the following platforms:

Windows 2003 Server SP1

Windows 2003 Server SP1 w/ Citrix PS 4.0

Windows 2003 Server SP1 (Terminal Server Application Mode)

Windows 2000 Server SP4

Windows 2000 Server SP4 w/ Citrix MF XP

Windows 2000 Server SP4 (Terminal Server Application Mode)

Windows 2000 Server SP4 w/ Citrix MF 1.8

Windows XP Professional (domain member)

The freeware version is offered AS IS. Ctrl-Alt-Del IT Consultancy has made

every effort possible to ensure that ICSWEEP is free of any bugs or errors,

however in no way is ICSWEEP to be considered error or bug free.

You assume all responsibility for any damages or lost data that may result

from any errors or bugs in ICSWEEP.

IN NO EVENT WILL CTRL-ALT-DEL IT CONSULTANCY BE LIABLE TO YOU FOR ANY GENERAL,

SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR OTHER DAMAGES ARISING OUT OF

THIS PRODUCT.

You will find the utility in Citrix / Terminal Server Utils CAD Util Pack. :thumbup

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

The command below should work. It will only work from a batch file (.cmd/.bat). It's all in one line.

FOR /F "tokens=*" %%a in ('dir "%SYSTEMDRIVE%\DOCUMENTS AND SETTINGS" /ad/b/o') DO DEL "%SystemDrive%\DOCUMENTS AND SETTINGS\%%a\LOCAL SETTINGS\TEMPORARY INTERNET FILES\*.*" /S /Q

The command does a DIR of the documents and settings directory then uses that to run a DEL command for each directory returned.

Cheers,

Kevin

Link to comment
Share on other sites

Thanks people, I had one too, took me a few minutes only, but with the help of two "external" tools. But as I'm starting it from a USB stick, or a BartPE disk, it's not a problem as those are in the directory.

FORFILES -pD:\DATA -m*. -c"deltree /y D:\DATA\@FILE\LocalS~1\Temp\*.*"

FORFILES -pD:\DATA -m*. -c"deltree /y D:\DATA\@FILE\LocalS~1\Tempor~1\*."

It does it.

Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...