Hey emjay, welcome to PCHF by the way.
There are some neat applications that can set this up for you, such as TweakXP. You'll pay a few pennies for this software, but it's worth it's weight in gold the features and tweaks this little utility comes with.
As a free alternative, if it's a script you would like, then it's a script you shall have jay.

Here we go.
- Copy and paste the following lines into notepad (
Start, Run, type in
notepad)
@echo off
path c:\windows
cd "%userprofile%\local settings\temp"
deltree /y *.*
cd "%userprofile%\local settings\temporary internet files"
deltree /y *.*
cd %userprofile%\cookies
deltree /y *.*
- Save it in
c:\documents and settings\all users\start menu\programs\startup
- Save it as
clearTemp.bat
- In Explorer, go to
Tools, Folder Options, followed by the
View tab. Untick
Hide extentions for known file types.
- After it has saved, have a look under your start menu, under startup and make sure that the file you just saved ends with a .bat extention. Notepad has the tendancy to add a .txt to the end of the file.
- Finally Download deltree from here:
http://www.uv.tietgen.dk/staff/mlha/...ft/DELTREE.EXE (and save it to your
c:\windows folder.
This will delete temp files on logon for the current user profile. You can schedule deletions. And if you want deletions to take effect on other user profiles, then change the
%userprofile% section of the script to the profile folder you would like to work with, for example:
c:\documents and settings\Bilbo Baggins