• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 510
  • Last Modified:

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
0
AGenMIS
Asked:
AGenMIS
  • 2
1 Solution
 
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
 
kevinhsiehCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now