Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > How to run a task when shutting down

Reply
Thread Tools Display Modes

How to run a task when shutting down

 
 
paroots
Guest
Posts: n/a

 
      06-01-2008
I wish to run a task (to dismount a network hard drive) whenever shutting
down. I have noticed that the Task Scheduler has a trigger called, 'On local
disconnect from any user session'. I have setup a task based on this trigger,
but it doesn't execute when I do a shutdown. Any ideas are much appreciated
 
Reply With Quote
 
 
 
 
solon fox
Guest
Posts: n/a

 
      06-01-2008
On Jun 1, 6:42*am, paroots <paro...@discussions.microsoft.com> wrote:
> I wish to run a task (to dismount a network hard drive) whenever shutting
> down. I have noticed that the Task Scheduler has a trigger called, 'On local
> disconnect from any user session'. I have setup a task based on this trigger,
> but it doesn't execute when I do a shutdown. Any ideas are much appreciated


Great question. I'd just like to point out that at disconnect from
user session is not the same as shutdown. I suspect that shutdown
begins a series of events that simply doesn't wait for your task to
even start let alone finish.

I would be very interested to learn how to force something to run at
shutdown.

Unless someone figures it out, why not just run your script at
startup? It seems to me that the end result would be very close.

-solon fox
 
Reply With Quote
 
Mark L. Ferguson
Guest
Posts: n/a

 
      06-01-2008
GPEDIT.MSC has a Logoff script feature.

--
click the Ratings button. Voting helps the web interface.
http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a post''
Mark L. Ferguson

"solon fox" <> wrote in message
news:d94a950e-6fc7-44f1-9a61-...
> On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com> wrote:
>> I wish to run a task (to dismount a network hard drive) whenever shutting
>> down. I have noticed that the Task Scheduler has a trigger called, 'On
>> local
>> disconnect from any user session'. I have setup a task based on this
>> trigger,
>> but it doesn't execute when I do a shutdown. Any ideas are much
>> appreciated

>
> Great question. I'd just like to point out that at disconnect from
> user session is not the same as shutdown. I suspect that shutdown
> begins a series of events that simply doesn't wait for your task to
> even start let alone finish.
>
> I would be very interested to learn how to force something to run at
> shutdown.
>
> Unless someone figures it out, why not just run your script at
> startup? It seems to me that the end result would be very close.
>
> -solon fox


 
Reply With Quote
 
paroots
Guest
Posts: n/a

 
      06-01-2008
Thanks for the responses; they're much appreciated. I googled on gpedit.msc
and discovered that it is a Windows XP feature? Is it available in Vista and
if so, how?

"Mark L. Ferguson" wrote:

> GPEDIT.MSC has a Logoff script feature.
>
> --
> click the Ratings button. Voting helps the web interface.
> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a post''
> Mark L. Ferguson
>
> "solon fox" <> wrote in message
> news:d94a950e-6fc7-44f1-9a61-...
> > On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com> wrote:
> >> I wish to run a task (to dismount a network hard drive) whenever shutting
> >> down. I have noticed that the Task Scheduler has a trigger called, 'On
> >> local
> >> disconnect from any user session'. I have setup a task based on this
> >> trigger,
> >> but it doesn't execute when I do a shutdown. Any ideas are much
> >> appreciated

> >
> > Great question. I'd just like to point out that at disconnect from
> > user session is not the same as shutdown. I suspect that shutdown
> > begins a series of events that simply doesn't wait for your task to
> > even start let alone finish.
> >
> > I would be very interested to learn how to force something to run at
> > shutdown.
> >
> > Unless someone figures it out, why not just run your script at
> > startup? It seems to me that the end result would be very close.
> >
> > -solon fox

>

 
Reply With Quote
 
Mark L. Ferguson
Guest
Posts: n/a

 
      06-01-2008
Click Start, and type:
gpedit.msc
hit enter
The path to the logoff script setting is:
Local Computer Policy/Computer Configuration/Windows
Settings/Scripts(Startup/Shutdown/...
It can, of course, be done on a per user basis at:
LCP/User Configuration/...
--
click the Ratings button. Voting helps the web interface.
http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a post''
Mark L. Ferguson

"paroots" <> wrote in message
news:13C19E33-D1A6-4E94-BBC2-...
> Thanks for the responses; they're much appreciated. I googled on
> gpedit.msc
> and discovered that it is a Windows XP feature? Is it available in Vista
> and
> if so, how?
>
> "Mark L. Ferguson" wrote:
>
>> GPEDIT.MSC has a Logoff script feature.
>>
>> --
>> click the Ratings button. Voting helps the web interface.
>> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
>> post''
>> Mark L. Ferguson
>>
>> "solon fox" <> wrote in message
>> news:d94a950e-6fc7-44f1-9a61-...
>> > On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com> wrote:
>> >> I wish to run a task (to dismount a network hard drive) whenever
>> >> shutting
>> >> down. I have noticed that the Task Scheduler has a trigger called, 'On
>> >> local
>> >> disconnect from any user session'. I have setup a task based on this
>> >> trigger,
>> >> but it doesn't execute when I do a shutdown. Any ideas are much
>> >> appreciated
>> >
>> > Great question. I'd just like to point out that at disconnect from
>> > user session is not the same as shutdown. I suspect that shutdown
>> > begins a series of events that simply doesn't wait for your task to
>> > even start let alone finish.
>> >
>> > I would be very interested to learn how to force something to run at
>> > shutdown.
>> >
>> > Unless someone figures it out, why not just run your script at
>> > startup? It seems to me that the end result would be very close.
>> >
>> > -solon fox

>>

 
Reply With Quote
 
paroots
Guest
Posts: n/a

 
      06-01-2008
Have tried it; can't find it in Windows Vista Home Premium?

"Mark L. Ferguson" wrote:

> Click Start, and type:
> gpedit.msc
> hit enter
> The path to the logoff script setting is:
> Local Computer Policy/Computer Configuration/Windows
> Settings/Scripts(Startup/Shutdown/...
> It can, of course, be done on a per user basis at:
> LCP/User Configuration/...
> --
> click the Ratings button. Voting helps the web interface.
> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a post''
> Mark L. Ferguson
>
> "paroots" <> wrote in message
> news:13C19E33-D1A6-4E94-BBC2-...
> > Thanks for the responses; they're much appreciated. I googled on
> > gpedit.msc
> > and discovered that it is a Windows XP feature? Is it available in Vista
> > and
> > if so, how?
> >
> > "Mark L. Ferguson" wrote:
> >
> >> GPEDIT.MSC has a Logoff script feature.
> >>
> >> --
> >> click the Ratings button. Voting helps the web interface.
> >> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
> >> post''
> >> Mark L. Ferguson
> >>
> >> "solon fox" <> wrote in message
> >> news:d94a950e-6fc7-44f1-9a61-...
> >> > On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com> wrote:
> >> >> I wish to run a task (to dismount a network hard drive) whenever
> >> >> shutting
> >> >> down. I have noticed that the Task Scheduler has a trigger called, 'On
> >> >> local
> >> >> disconnect from any user session'. I have setup a task based on this
> >> >> trigger,
> >> >> but it doesn't execute when I do a shutdown. Any ideas are much
> >> >> appreciated
> >> >
> >> > Great question. I'd just like to point out that at disconnect from
> >> > user session is not the same as shutdown. I suspect that shutdown
> >> > begins a series of events that simply doesn't wait for your task to
> >> > even start let alone finish.
> >> >
> >> > I would be very interested to learn how to force something to run at
> >> > shutdown.
> >> >
> >> > Unless someone figures it out, why not just run your script at
> >> > startup? It seems to me that the end result would be very close.
> >> >
> >> > -solon fox
> >>

>

 
Reply With Quote
 
paroots
Guest
Posts: n/a

 
      06-02-2008
Hello Mark:
I've googled on gpedit.msc and have not found any indication that this
command is available in Windows Vista Home Premium. Perhaps I have something
else that accomplishes the same thing. Any ideas?

"Mark L. Ferguson" wrote:

> Click Start, and type:
> gpedit.msc
> hit enter
> The path to the logoff script setting is:
> Local Computer Policy/Computer Configuration/Windows
> Settings/Scripts(Startup/Shutdown/...
> It can, of course, be done on a per user basis at:
> LCP/User Configuration/...
> --
> click the Ratings button. Voting helps the web interface.
> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a post''
> Mark L. Ferguson
>
> "paroots" <> wrote in message
> news:13C19E33-D1A6-4E94-BBC2-...
> > Thanks for the responses; they're much appreciated. I googled on
> > gpedit.msc
> > and discovered that it is a Windows XP feature? Is it available in Vista
> > and
> > if so, how?
> >
> > "Mark L. Ferguson" wrote:
> >
> >> GPEDIT.MSC has a Logoff script feature.
> >>
> >> --
> >> click the Ratings button. Voting helps the web interface.
> >> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
> >> post''
> >> Mark L. Ferguson
> >>
> >> "solon fox" <> wrote in message
> >> news:d94a950e-6fc7-44f1-9a61-...
> >> > On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com> wrote:
> >> >> I wish to run a task (to dismount a network hard drive) whenever
> >> >> shutting
> >> >> down. I have noticed that the Task Scheduler has a trigger called, 'On
> >> >> local
> >> >> disconnect from any user session'. I have setup a task based on this
> >> >> trigger,
> >> >> but it doesn't execute when I do a shutdown. Any ideas are much
> >> >> appreciated
> >> >
> >> > Great question. I'd just like to point out that at disconnect from
> >> > user session is not the same as shutdown. I suspect that shutdown
> >> > begins a series of events that simply doesn't wait for your task to
> >> > even start let alone finish.
> >> >
> >> > I would be very interested to learn how to force something to run at
> >> > shutdown.
> >> >
> >> > Unless someone figures it out, why not just run your script at
> >> > startup? It seems to me that the end result would be very close.
> >> >
> >> > -solon fox
> >>

>

 
Reply With Quote
 
Rick Rogers
Guest
Posts: n/a

 
      06-02-2008
It's not, Business, Enterprise, and Ultimate only.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com

"paroots" <> wrote in message
news:E71AC796-2E8F-4685-8608-...
> Hello Mark:
> I've googled on gpedit.msc and have not found any indication that this
> command is available in Windows Vista Home Premium. Perhaps I have
> something
> else that accomplishes the same thing. Any ideas?
>
> "Mark L. Ferguson" wrote:
>
>> Click Start, and type:
>> gpedit.msc
>> hit enter
>> The path to the logoff script setting is:
>> Local Computer Policy/Computer Configuration/Windows
>> Settings/Scripts(Startup/Shutdown/...
>> It can, of course, be done on a per user basis at:
>> LCP/User Configuration/...
>> --
>> click the Ratings button. Voting helps the web interface.
>> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
>> post''
>> Mark L. Ferguson
>>
>> "paroots" <> wrote in message
>> news:13C19E33-D1A6-4E94-BBC2-...
>> > Thanks for the responses; they're much appreciated. I googled on
>> > gpedit.msc
>> > and discovered that it is a Windows XP feature? Is it available in
>> > Vista
>> > and
>> > if so, how?
>> >
>> > "Mark L. Ferguson" wrote:
>> >
>> >> GPEDIT.MSC has a Logoff script feature.
>> >>
>> >> --
>> >> click the Ratings button. Voting helps the web interface.
>> >> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
>> >> post''
>> >> Mark L. Ferguson
>> >>
>> >> "solon fox" <> wrote in message
>> >> news:d94a950e-6fc7-44f1-9a61-...
>> >> > On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com>
>> >> > wrote:
>> >> >> I wish to run a task (to dismount a network hard drive) whenever
>> >> >> shutting
>> >> >> down. I have noticed that the Task Scheduler has a trigger called,
>> >> >> 'On
>> >> >> local
>> >> >> disconnect from any user session'. I have setup a task based on
>> >> >> this
>> >> >> trigger,
>> >> >> but it doesn't execute when I do a shutdown. Any ideas are much
>> >> >> appreciated
>> >> >
>> >> > Great question. I'd just like to point out that at disconnect from
>> >> > user session is not the same as shutdown. I suspect that shutdown
>> >> > begins a series of events that simply doesn't wait for your task to
>> >> > even start let alone finish.
>> >> >
>> >> > I would be very interested to learn how to force something to run at
>> >> > shutdown.
>> >> >
>> >> > Unless someone figures it out, why not just run your script at
>> >> > startup? It seems to me that the end result would be very close.
>> >> >
>> >> > -solon fox
>> >>

>>


 
Reply With Quote
 
paroots
Guest
Posts: n/a

 
      06-02-2008
Thanks Rick. I thought I was losing my mind. Anyone have any ideas how to
scheule a batch file to run on shutdown?

"Rick Rogers" wrote:

> It's not, Business, Enterprise, and Ultimate only.
>
> --
> Best of Luck,
>
> Rick Rogers, aka "Nutcase" - Microsoft MVP
> http://mvp.support.microsoft.com/
> Windows help - www.rickrogers.org
> My thoughts http://rick-mvp.blogspot.com
>
> "paroots" <> wrote in message
> news:E71AC796-2E8F-4685-8608-...
> > Hello Mark:
> > I've googled on gpedit.msc and have not found any indication that this
> > command is available in Windows Vista Home Premium. Perhaps I have
> > something
> > else that accomplishes the same thing. Any ideas?
> >
> > "Mark L. Ferguson" wrote:
> >
> >> Click Start, and type:
> >> gpedit.msc
> >> hit enter
> >> The path to the logoff script setting is:
> >> Local Computer Policy/Computer Configuration/Windows
> >> Settings/Scripts(Startup/Shutdown/...
> >> It can, of course, be done on a per user basis at:
> >> LCP/User Configuration/...
> >> --
> >> click the Ratings button. Voting helps the web interface.
> >> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
> >> post''
> >> Mark L. Ferguson
> >>
> >> "paroots" <> wrote in message
> >> news:13C19E33-D1A6-4E94-BBC2-...
> >> > Thanks for the responses; they're much appreciated. I googled on
> >> > gpedit.msc
> >> > and discovered that it is a Windows XP feature? Is it available in
> >> > Vista
> >> > and
> >> > if so, how?
> >> >
> >> > "Mark L. Ferguson" wrote:
> >> >
> >> >> GPEDIT.MSC has a Logoff script feature.
> >> >>
> >> >> --
> >> >> click the Ratings button. Voting helps the web interface.
> >> >> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
> >> >> post''
> >> >> Mark L. Ferguson
> >> >>
> >> >> "solon fox" <> wrote in message
> >> >> news:d94a950e-6fc7-44f1-9a61-...
> >> >> > On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com>
> >> >> > wrote:
> >> >> >> I wish to run a task (to dismount a network hard drive) whenever
> >> >> >> shutting
> >> >> >> down. I have noticed that the Task Scheduler has a trigger called,
> >> >> >> 'On
> >> >> >> local
> >> >> >> disconnect from any user session'. I have setup a task based on
> >> >> >> this
> >> >> >> trigger,
> >> >> >> but it doesn't execute when I do a shutdown. Any ideas are much
> >> >> >> appreciated
> >> >> >
> >> >> > Great question. I'd just like to point out that at disconnect from
> >> >> > user session is not the same as shutdown. I suspect that shutdown
> >> >> > begins a series of events that simply doesn't wait for your task to
> >> >> > even start let alone finish.
> >> >> >
> >> >> > I would be very interested to learn how to force something to run at
> >> >> > shutdown.
> >> >> >
> >> >> > Unless someone figures it out, why not just run your script at
> >> >> > startup? It seems to me that the end result would be very close.
> >> >> >
> >> >> > -solon fox
> >> >>
> >>

>
>

 
Reply With Quote
 
Mark L. Ferguson
Guest
Posts: n/a

 
      06-02-2008
It's possible to launch a hidden IE window at startup (wscript shell.run
command, second argument). This could run a *.HTA file and would allow
scripting, to have a set of script commands run 'OnExit' for the .hta page.
(This would only work with the consent, or lack of ability of the user.)

--
click the Ratings button. Voting helps the web interface.
http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a post''
Mark L. Ferguson

"paroots" <> wrote in message
news:6A3CFB95-03F2-4934-9989-...
> Thanks Rick. I thought I was losing my mind. Anyone have any ideas how to
> scheule a batch file to run on shutdown?
>
> "Rick Rogers" wrote:
>
>> It's not, Business, Enterprise, and Ultimate only.
>>
>> --
>> Best of Luck,
>>
>> Rick Rogers, aka "Nutcase" - Microsoft MVP
>> http://mvp.support.microsoft.com/
>> Windows help - www.rickrogers.org
>> My thoughts http://rick-mvp.blogspot.com
>>
>> "paroots" <> wrote in message
>> news:E71AC796-2E8F-4685-8608-...
>> > Hello Mark:
>> > I've googled on gpedit.msc and have not found any indication that this
>> > command is available in Windows Vista Home Premium. Perhaps I have
>> > something
>> > else that accomplishes the same thing. Any ideas?
>> >
>> > "Mark L. Ferguson" wrote:
>> >
>> >> Click Start, and type:
>> >> gpedit.msc
>> >> hit enter
>> >> The path to the logoff script setting is:
>> >> Local Computer Policy/Computer Configuration/Windows
>> >> Settings/Scripts(Startup/Shutdown/...
>> >> It can, of course, be done on a per user basis at:
>> >> LCP/User Configuration/...
>> >> --
>> >> click the Ratings button. Voting helps the web interface.
>> >> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate a
>> >> post''
>> >> Mark L. Ferguson
>> >>
>> >> "paroots" <> wrote in message
>> >> news:13C19E33-D1A6-4E94-BBC2-...
>> >> > Thanks for the responses; they're much appreciated. I googled on
>> >> > gpedit.msc
>> >> > and discovered that it is a Windows XP feature? Is it available in
>> >> > Vista
>> >> > and
>> >> > if so, how?
>> >> >
>> >> > "Mark L. Ferguson" wrote:
>> >> >
>> >> >> GPEDIT.MSC has a Logoff script feature.
>> >> >>
>> >> >> --
>> >> >> click the Ratings button. Voting helps the web interface.
>> >> >> http://www.microsoft.com/wn3/locales...help_en-us.htm see ''rate
>> >> >> a
>> >> >> post''
>> >> >> Mark L. Ferguson
>> >> >>
>> >> >> "solon fox" <> wrote in message
>> >> >> news:d94a950e-6fc7-44f1-9a61-...
>> >> >> > On Jun 1, 6:42 am, paroots <paro...@discussions.microsoft.com>
>> >> >> > wrote:
>> >> >> >> I wish to run a task (to dismount a network hard drive) whenever
>> >> >> >> shutting
>> >> >> >> down. I have noticed that the Task Scheduler has a trigger
>> >> >> >> called,
>> >> >> >> 'On
>> >> >> >> local
>> >> >> >> disconnect from any user session'. I have setup a task based on
>> >> >> >> this
>> >> >> >> trigger,
>> >> >> >> but it doesn't execute when I do a shutdown. Any ideas are much
>> >> >> >> appreciated
>> >> >> >
>> >> >> > Great question. I'd just like to point out that at disconnect
>> >> >> > from
>> >> >> > user session is not the same as shutdown. I suspect that shutdown
>> >> >> > begins a series of events that simply doesn't wait for your task
>> >> >> > to
>> >> >> > even start let alone finish.
>> >> >> >
>> >> >> > I would be very interested to learn how to force something to run
>> >> >> > at
>> >> >> > shutdown.
>> >> >> >
>> >> >> > Unless someone figures it out, why not just run your script at
>> >> >> > startup? It seems to me that the end result would be very close.
>> >> >> >
>> >> >> > -solon fox
>> >> >>
>> >>

>>
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Task Scheduler Task Accidental Deletion DownTheShore Windows Vista Performance 4 05-23-2008 10:17 PM
Task scheduler returns an error : the task image is corrupt ortamp Jean-David Windows Vista Performance 2 05-03-2008 02:02 PM
task scheduler doesn't start delayed task wuschba Windows Vista General Discussion 6 07-26-2007 08:06 AM
Task Scheduler: Repeat Task and Duration kirsch59 Windows Vista General Discussion 6 07-11-2007 09:01 PM
Task scheduler problem : task do not close Junkyard Engineer Windows Vista General Discussion 0 06-07-2007 01:51 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59