Ponch Posted January 25, 2008 Share Posted January 25, 2008 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 FilesI have PCs with more than 20 profiles. THANKS ! I did search a bit. Link to comment Share on other sites More sharing options...
Yzöwl Posted January 26, 2008 Share Posted January 26, 2008 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 More sharing options...
Ponch Posted January 26, 2008 Author Share Posted January 26, 2008 It's not an easy task at allI said "show my ignorance" not "emphasize" . Thanks anyway.The difficulty, I guess, is to get all the profiles names. Link to comment Share on other sites More sharing options...
Bilou_Gateux Posted February 15, 2008 Share Posted February 15, 2008 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 FilesI 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 FilesCache and/or the TEMP files folder of ALL user profiles that are NOT in usewhen this command is executed. This utility was written for the purpose ofallowing a SINGLE command to identify and clear Temporary Internet FilesCache 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 addedas a SCHEDULED TASK for regular cleaning of user profiles, reducing theoverall 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 theprofile 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 fileICSWEEP without parameters will execute the /TIF switch by default.The program returns a running list of the processed profiles. To store theoutput run the following command: ICSWEEP.EXE>ICSWEEP.txtThis utility is FREEWARE and was written by Warren Simondson ofCtrl-Alt-Del IT Consultancy, Australia. www.ctrl-alt-del.com.auAlthough written for Terminal Server and Citrix environments, this applicationwill function on non-TS/Citrix workstations and servers.This application has been tested on the following platforms:Windows 2003 Server SP1Windows 2003 Server SP1 w/ Citrix PS 4.0Windows 2003 Server SP1 (Terminal Server Application Mode)Windows 2000 Server SP4Windows 2000 Server SP4 w/ Citrix MF XPWindows 2000 Server SP4 (Terminal Server Application Mode)Windows 2000 Server SP4 w/ Citrix MF 1.8Windows XP Professional (domain member)The freeware version is offered AS IS. Ctrl-Alt-Del IT Consultancy has madeevery 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 resultfrom 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. Link to comment Share on other sites More sharing options...
bigkevgray Posted March 4, 2008 Share Posted March 4, 2008 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 /QThe 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 More sharing options...
Ponch Posted March 10, 2008 Author Share Posted March 10, 2008 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 More sharing options...
Yzöwl Posted March 10, 2008 Share Posted March 10, 2008 Well I suppose that if your happy with it then thats fine, but I would never remove the entire tree under those paths! Link to comment Share on other sites More sharing options...
fredmsfn Posted December 3, 2008 Share Posted December 3, 2008 Thanks for this information! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now