Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

W2K3 Group Policy Shutdown Script

Posted on 2011-02-25
3
Medium Priority
?
503 Views
Last Modified: 2012-06-27
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
Comment
Question by:AGenMIS
  • 2
3 Comments
 
LVL 42

Expert Comment

by:kevinhsieh
ID: 34986149
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
 

Author Comment

by:AGenMIS
ID: 35141511
Making it a logoff script worked. Any way to get it to work if I want to make it a shut down script?
0
 
LVL 42

Accepted Solution

by:
kevinhsieh earned 2000 total points
ID: 35150391
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Loops Section Overview
Screencast - Getting to Know the Pipeline

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question