Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Temp files for all profiles

Status
Not open for further replies.

placster

MIS
Mar 30, 2005
2
US
I have been looking around for a program or a batch file to delete temp files, Temporary internet files, etc. from all profiles. I looked at the tool that comes with windows (disk cleanup) but it seems to only work with the default user or the user that is logged in. I would like to do this remotely if at all possible. I have about 100 computers on my network and need to do some system administration. Any ideas?
 
MHNetwork,

put this in a .bat file:
@echo off
chdir c:\temp
if "%3"=="" goto GETDATE
if "%4"=="" goto SETTIME
goto SETDATE
:SETTIME
set TIME=%3
goto DONE
:SETDATE
set DATE=%4
goto DONE
:GETDATE
echo.|date>temp.bat
call temp.bat
echo.|time>temp.bat
call temp.bat
if exist temp.bat del temp.bat
goto DONE
:DONE
echo File generated at %date% %time% >> c:\temp\temp.log
dir /OD >> c:\temp\temp.log
move c:\temp\temp.log c:\temp.log
del /q *.*

change your directory as needed. then use windows scheduler to call the .bat scripts.
another thought - change the enviroment variable to point to c:\temp for all users rather than the one that windows creates (which is different for each user).

hth
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top