Re: Detect logoff or shutdown

Tech-Archive recommends: Fix windows errors by optimizing your registry



"mr_unreliable" <kindlyReplyToNewsgroup@xxxxxxxxxxx> wrote in message
news:%23ckcqj1oJHA.1172@xxxxxxxxxxxxxxxxxxxxxxx
James Whitlow wrote:
Does anyone in the group know if it is possible to detect whether the
computer is shutting down or restarting from a VBScript running as a
shutdown script?


hi James,

There is an answer, but you are not going to like it.

I may not like, but always appreciate an informed reply! Thanks!

My question is, can FBSL tell whether or not the shutdown is a power off
shutdown or a restart shutdown? I already have my scripting running at
shutdown using the shutdown GPO script method. The problem is that the
script I am wanting to run takes longer than the default 10 minutes timeout,
so I run my main script on the second shutdown. I first run the script to
set the 'MaxGPOScriptWait' registry key to 0. If this setting took effect
immediately, I would be good, but it does not. If I can either detect if
they select 'Restart', I could write a startup script to restart the
computer at startup and delete the script. I don't want to do this if they
are no restarting since it will cause a long delay for them when they start
the computer back up. Alternatively, if I could intercept the shutdown from
the shutdown script and force it to become a restart, that would work as
well.


.



Relevant Pages

  • RE: Finetuning: Remote Shutdown with WMI, some errors occur.
    ... Also we would like that a workstation that's locked is also shutdown by this ... script to shutdown all approx. ... Dim strBase, strFilter, strAttributes, strQuery, objRecordSet ... Const OpenAsDefault = -2 ...
    (microsoft.public.windows.server.scripting)
  • Re: VBscript that restart the domain comptuer
    ... If you have a shutdown script that cleans up the profiles, ... permissions can restart all computers in a list remotely. ... I have already VB script I ...
    (microsoft.public.windows.server.active_directory)
  • Re: Fail to restart server remotely
    ... hitting the restart. ... Would be nice to just run a script .... ... I'd like to add trend shutdown to my suite of shutdown scripts that folks ... have anybody on staff that can reboot the server. ...
    (microsoft.public.windows.server.sbs)
  • RE: Script or Other Method to Reboot
    ... > We need different privileges when using Shutdown command and shutdown the ... > that only administrator will use command to shutdown the computers. ... > we may need to compile the script. ...
    (microsoft.public.windowsxp.configuration_manage)
  • Re: Finetuning: Remote Shutdown with WMI, some errors occur.
    ... Allows shutdown, poweroff, or reboot of multiple remote systems. ... - generic unhandled script compile or runtime error; ... "Specify 1 and only one shutdown action" ... Dim erNumber, erDesc ...
    (microsoft.public.windows.server.scripting)