Deleting XP Multiple Users Temp Internet Files


Recommended Posts

Hi,

When I go onsite to a clients systems and have to run a vrius checker or scan on their system, it takes ages due to the crap in temporary internet files and temp files.

If the system has one user then it's not so much of a problem as I can quickly delete the temporary internet files and temp files.

The problem I encounter is when there are multiple users on the the system. It takes too long to log in as each user as do the deletion.

Is there an easier way? Maybe a little freeware app that can do the job? OR even a simple batch file to delete all the temp files in one go regardless of how many users?

Hope I've explained myself correctly :) and hope someone can come up with a good idea :)

Many thanks

I know I can log in as Administrator and set "Folder Options" to "Show hidden files and folders", then delete the contents of "Temporary Internet Files" and "Temp" under the "Local Settings" folder for each user.

But that is long and tedious. I'm hopinh a simple batch file or standalone exe app could do it. I don't want to have to install an app on the users pc to do the task.

I know the following batch file will delete the contents of "Temporary Internet Files" for the currently logged on user...

RD "%Systemdrive%\documents and settings\%USERNAME%\local settings\Temporary Internet Files\" /S /Q
MD "%Systemdrive%\documents and settings\%USERNAME%\local settings\Temporary Internet Files"

Is there something all those lines that would do it for all user account rather than just the currently logged on user?

I hope I'm explaining myself properly :)

Many thanks

Ok, here's what I've got so far...

REM Written by Sony Nair (UniqueTouch)
REM (http://www.uniquetouch.co.uk)
REM v1.0 02/02/2004
cls
@echo off
title Temp Files Remover for Windows XP
echo.
echo This will delete the follwing files for the currently logged in user on WinXP...
echo.
echo - Windows Prefetch Folder Content
echo - Windows Temp Files
echo - Temp Files Content
echo - Temporary Internet Files Content
echo.
echo Press any key to continue or close this window to exit.
Pause > nul
echo.
echo Emptying Windows Prefetch folder...
del "%Systemdrive%\windows\prefetch\*.*" /q
echo Done.
echo.
echo Removing Windows Temp Files...
rd "%systemdrive%\windows\Temp" /s /q
md "%systemdrive%\windows\Temp"
echo Done.
echo.
echo Removing Temp Files...
rd "%Systemdrive%%homepath%\local settings\Temp\" /s /q
md "%Systemdrive%%homepath%\local settings\Temp"
echo Done.
echo.
echo Removing Temporary Internet Files...
rd "%Systemdrive%%homepath%\local settings\Temporary Internet Files\" /s /q
md "%Systemdrive%%homepath%\local settings\Temporary Internet Files"
echo Done.
echo.
echo.
echo Deletion finished...
echo.
echo Press any key or close this window to exit.
Pause > nul

But the deletion of the "Temp" files and "Temporary Internet Files" is only for the currently logged on user.

Anyone got any ideas of how I can do it for other accounts without hardcosing the account names in?

P.s. I've attched the cmd file in case anyone wants to use what I have done so far.

DelTempFiles_WinXP.zipFetching info...

i want to know this too... :hmmm: it's quite annoying, for similar reasons.

i can think of a workaround:

in internet options, click the advanced tab. scroll to the bottom and check the box labeled "empty temporary internet files folder when browser is closed". whenever a user closes all IE windows (logoff) their cache will be emptied. but this isn't exactly what i'm looking for...

  gameguy said:
i want to know this too... :hmmm: it's quite annoying, for similar reasons.

i can think of a workaround:

in internet options, click the advanced tab. scroll to the bottom and check the box labeled "empty temporary internet files folder when browser is closed". whenever a user closes all IE windows (logoff) their cache will be emptied. but this isn't exactly what i'm looking for...

Thats a good idea gameguy, thanks.

Obviously thats only an otion I can use once I've visited the users machine which will save me the hassle of deleting temp inet files next time round.

I'm sure using CMD Scripting there is a way to figure out to call the user account names and then insert them using variables into a script similar to above.

Anybody able to shed some light on CMD Scripting?

Many thanks

Hi hurtng1,

Thanks for the code...

I understand what you say about how to use the "%%8".

But I would like to understand the code better if I can.

Can you explain the code or if possible point me to a site that has a tutorial?

Many thanks

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.