Windows Logoff and Shutdown scipts

M

mike2288

Hi, First of all i would like to let you know im new to MMC scripts, (if
thats what you refer them to) Basically im trying to ask windows to
automatically perform Scandisk and Defrag through MMC scripts, when i run the
batch files ive written they perform as i want them to,

but i have used MMC and started a new console then ive added a new snap-in (
Snap-ins added to: Console root )
then clicked add.. Group Policy Object Editor, Group Policy Object = Local
computer then finish, close the dialog box click ok then drill down.

Local computer Policy> Computer Configuration> Windows settings> Scripts
Startup and shutdown

then i open the shutdown script properties in which i have added the Defrag
and scandisk scripts then saved as console1 and ive changed Run shutdown
scripts visible to enable to be able to view them when they start

Then nothing happens at all its like they dont exist and i dont know how to
assign them to to the computer when its shuts down

if anyone can help to see if i havent done something correct it would be
appreciated, Thanks for reading, Mike
 
P

Pegasus [MVP]

mike2288 said:
Hi, First of all i would like to let you know im new to MMC scripts, (if
thats what you refer them to) Basically im trying to ask windows to
automatically perform Scandisk and Defrag through MMC scripts, when i run
the
batch files ive written they perform as i want them to,

but i have used MMC and started a new console then ive added a new snap-in
(
Snap-ins added to: Console root )
then clicked add.. Group Policy Object Editor, Group Policy Object = Local
computer then finish, close the dialog box click ok then drill down.

Local computer Policy> Computer Configuration> Windows settings> Scripts
Startup and shutdown

then i open the shutdown script properties in which i have added the
Defrag
and scandisk scripts then saved as console1 and ive changed Run shutdown
scripts visible to enable to be able to view them when they start

Then nothing happens at all its like they dont exist and i dont know how
to
assign them to to the computer when its shuts down

if anyone can help to see if i havent done something correct it would be
appreciated, Thanks for reading, Mike

The policy you used allows you to run "shutdown" scripts. It says nothing
about "logoff" scripts. The scripts must reside in the folder
C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Shutdown. Why they do not
work for you is hard to say unless you post them here. A good way to debug
them is to make them really, really simple, e.g. like so:

@echo off
echo %UserName% %date% %time% >> c:\Mike.txt
[add your own code here]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top