Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Logon or loggoff script w. GP

9 views
Skip to first unread message

Daniel Bonning

unread,
May 13, 2002, 1:11:34 PM5/13/02
to
Hi there,

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?

Jori Jaatinen

unread,
May 13, 2002, 11:22:25 PM5/13/02
to
Daniel,

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 Bonning

unread,
May 21, 2002, 9:58:31 AM5/21/02
to
Thanks a million. I'm putting your advice into practice :)

Daniel

>.
>

0 new messages