I want to create a logon or logoff script that will be
implemented on my native mode W2K domain and should empty
the temp folder of every workstation that users log on to
or off of. I know scripts are kinda off-topic but I was
hoping someone could provide me with the proper syntax for
my needs. Should this GP be implemented via computer
config or user config in the GPO? What is the best
practice? Also, is there a specific location that the
script must be kept in on the DC?
When you configure scripts under the group policy (and you'll want to do
this for the user because you'll need access to relevant user environment
variables, unless you have other temp folders that are hard coded), there is
an option to show scripts to configure.
When you click on this button, it'll open an explorer view, which will allow
you to right click, create a new text file, call it CleanTemps.CMD, and put
in some simple batch script to clean up temp drives.
A simple script would be something like:
@ECHO OFF
ECHO Y|DEL /F /S %TEMP%\*.*
FOR /F "TOKENS=1 DELIMS=1" %%I IN ('DIR /B %TEMP%') DO ECHO Y|RD /S
%TEMP%\%%I >NUL 2>>&1
ECHO Y|DEL /F /S %TMP%\*.*
FOR /F "TOKENS=1 DELIMS=1" %%I IN ('DIR /B %TMP%') DO ECHO Y|RD /S %TMP%\%%I
>NUL 2>>&1
This basically cleans all files in the folders referenced by %TMP% and
%TEMP% and all subdirectories/files. This script will be replicated to other
DCs in the domain.
Jori
"Daniel Bonning" <daniel...@hotmail.com> wrote in message
news:303101c1faa1$3bfcdab0$35ef2ecf@TKMSFTNGXA11...
Daniel
>.
>