W2K3 Group Policy Shutdown Script

I created a batch file to delete temp files. I added this file to the shutdown script in Group Policy but it doesn't seem to be deleting my temps. Will this work through Group Policy? Below is what I came up with.

RD /S /Q %temp%
RD /S /Q C:\Windows\Temp
AGenMISAsked:
Who is Participating?
 
kevinhsiehConnect With a Mentor Commented:
You would run the same script as a shutdown script. You need to run it as both a logoff and shutdown script to get everything.
0
 
kevinhsiehCommented:
Is it not deleting from either location, or just not %temp%? This is a shutdown script, so the %temp% that you see is part of your profile, which isn't part of the system profile and hence it isn't affected by the shutdown script. If you want the individual %temp% directories to get cleaned out you need to make it a logoff script.

you can also try "del %temp%\*.* /s /q"
0
 
AGenMISAuthor Commented:
Making it a logoff script worked. Any way to get it to work if I want to make it a shut down script?
0
All Courses

From novice to tech pro — start learning today.