I found on MS Technet this useful script that help to perform a disk cleanup temp files on Windows Xp, Vista and 7 computers. It deletes all User and System Temp files & Internet Explorer files. Note: we have one subroutine called "DeleteTemp" to delete temp files and folders and One Function called FindOSType to get the Windows Version to determine the path of Internet Temp files. you can assign this script to Login or logoff script in a GPO to cleanup all temp files and folders Source : Delete Temp Files
I have checked the same, it's not working