this is a potentially dangerous file, and also pointless.
Its dangerous because it removes the temporary directory, then recreates it. But what if something is using it at the time? Permission denied on the delete you would think, but what if something tries to use it at the point between its deletion and its creation?
The safe way of cleaning temporary files is to use the "disk cleanup" tool on the drive.
It's pointless because a) it doesn't speed anything up, it just saves disk space and b) there are better ways of doing this.
at the
very least if you want to use this you should use del /s /q %temp%/* instead of deleting the entire directory, but really you should use the methods already provided. There are probably also tools that come with windows to decrease the temporary directory's maximum size or the expiry time that files stay in there, which would be much better.
If you are going to post a batch file, it should at least be useful. For eample the following will pull all the custom gif emoticons that are used in msn/windows live messenger etc on all messenger accounts and place them in the root msn data directory.
Code:
cd %appdata%\Microsoft\MSN Messenger
findstr /S /M "GIF*" *.dat | find "CustomEmoticons">allGifs.txt
for /F "tokens=1" %%i in (allGifs.txt) do copy /Y %%i %%i.gif
del allGifs.txt
This is messy because you can't use the | pipe inside the for command so it has to create a temporary file, which adds 2 lines to the batch file, but you should get the idea of what a useful and relatively powerful batch file may be.