Jump to content

Shutdown script


Recommended Posts

Guest Stephen Ford
Posted

Is there a script that runs on shutdown to enable intervention prior to

shutdown commencing?

 

--

Regards

Stephen Ford

  • Replies 7
  • Created
  • Last Reply
Posted

RE: Shutdown script

 

Do you mean "abort"? as in: shutdown.exe -a

 

"Stephen Ford" wrote:

> Is there a script that runs on shutdown to enable intervention prior to

> shutdown commencing?

>

> --

> Regards

> Stephen Ford

>

>

>

Guest David H. Lipman
Posted

Re: Shutdown script

 

From: "Stephen Ford" <stephen_ford_NO_@_SPAM_uwclub.net>

 

| Is there a script that runs on shutdown to enable intervention prior to

| shutdown commencing?

|

 

WinXP Home or Professional ?

 

If it is Professional...

 

Execute; GPEDIT.MSC

 

Go to...

Computer configuration --> windows settings --> scripts (startup/shutdown)

Choose; Shutdown

 

Add your script.

 

--

Dave

http://www.claymania.com/removal-trojan-adware.html

Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp

Guest createwindow@gmail.com
Posted

Re: Shutdown script

 

Hi Stephen,

 

You can use a batch file to shutdown your PC and put your shutdown

tasks before the final line that says shutdown /s /t 0

Of course this relies on the user clicking on (running) this batch

file rather than just a menu start / shutdown mouse or keyboard

sequence.

 

The batch file would look like:

 

call dostuff.bat

shutdown /s /t 0

 

 

The problem with a dedicated program or service that watches for

shutdown is that the machine IS shutting down! So you can't do

anything reliably - you may get away with doing some task if its quick

- but only some of the time - without certainty.

 

Here is a VBScript that I use on some client desktops - I tell them to

"run this icon" to shut down.

 

Option Explicit

Dim Res, strCmd, ExitCode, WshShell

Const EVENT_SUCCESS = 0

 

Res = MsgBox("Are you sure?", vbYesNo, "Shutdown Computer")

 

If Res <> vbYes then

Wscript.Quit

End If

 

strCmd = "shutdown /s /t 0"

 

 

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.LogEvent EVENT_SUCCESS, "Normal user shutdown command at -

" & Now()

ExitCode = WshShell.Run(strCmd, 10, TRUE )

Set WshShell = Nothing

 

 

 

Hope that helps.

CreateWindow

http://mymessagetaker.com

The while-you-were-out message program you have been looking for!

Guest David H. Lipman
Posted

Re: Shutdown script

 

From: <createwindow@gmail.com>

 

< snip >

 

|

| Option Explicit

| Dim Res, strCmd, ExitCode, WshShell

| Const EVENT_SUCCESS = 0

|

| Res = MsgBox("Are you sure?", vbYesNo, "Shutdown Computer")

|

| If Res <> vbYes then

| Wscript.Quit

| End If

|

| strCmd = "shutdown /s /t 0"

|

| Set WshShell = WScript.CreateObject("WScript.Shell")

| WshShell.LogEvent EVENT_SUCCESS, "Normal user shutdown command at -

| " & Now()

| ExitCode = WshShell.Run(strCmd, 10, TRUE )

| Set WshShell = Nothing

|

 

That's funny. You have to do all that in VBS.

 

All you have to do in KiXtart is...

 

ShutDown ("computer", "message", wait, force, options)

 

He, he...

 

--

Dave

http://www.claymania.com/removal-trojan-adware.html

Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp

Guest createwindow@gmail.com
Posted

Re: Shutdown script

 

Dave,

 

KiXtart looks way cool & where have I been to have missed it? Since

1991 too I note!

Just shows I don't know everything after all :-)

 

CareWare too - neat....

 

 

CreateWindow(LPCTSTR lpClassName........ etc. The WinAPI can bw worse

then VBScript!

Guest David H. Lipman
Posted

Re: Shutdown script

 

From: <createwindow@gmail.com>

 

| Dave,

|

| KiXtart looks way cool & where have I been to have missed it? Since

| 1991 too I note!

| Just shows I don't know everything after all :-)

|

| CareWare too - neat....

|

| CreateWindow(LPCTSTR lpClassName........ etc. The WinAPI can bw worse

| then VBScript!

 

I wrote my Multi AV Scanning Tool entirely in KiXtart

 

Download MULTI_AV.EXE from the URL --

http://www.pctipp.ch/ds/28400/28470/Multi_AV.exe

 

http://www.raymond.cc/blog/archives/2008/01/09/scan-your-computer-with-multiple-anti-virus-for-free/

 

--

Dave

http://www.claymania.com/removal-trojan-adware.html

Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp

Guest Newbie Coder
Posted

Re: Shutdown script

 

Technet Script Centre has all the free scripts you'll ever need & tools to create others

 

http://www.microsoft.com/technet/scriptcenter/default.mspx

 

The only true way is to temporily revoke the Shutdown privilege, do your stuff then

re-enable that privilege as when you start shutdown it will always continue with unloading

the 32/64 bit items & once out of that mode you aren't doing anything these days as such

 

--

Newbie Coder

(It's just a name)

 

 

"David H. Lipman" <DLipman~nospam~@Verizon.Net> wrote in message

news:eTILmQpcIHA.5348@TK2MSFTNGP03.phx.gbl...

> From: <createwindow@gmail.com>

>

> | Dave,

> |

> | KiXtart looks way cool & where have I been to have missed it? Since

> | 1991 too I note!

> | Just shows I don't know everything after all :-)

> |

> | CareWare too - neat....

> |

> | CreateWindow(LPCTSTR lpClassName........ etc. The WinAPI can bw worse

> | then VBScript!

>

> I wrote my Multi AV Scanning Tool entirely in KiXtart

>

> Download MULTI_AV.EXE from the URL --

> http://www.pctipp.ch/ds/28400/28470/Multi_AV.exe

>

>

http://www.raymond.cc/blog/archives/2008/01/09/scan-your-computer-with-multiple-anti-virus-for-free/

>

> --

> Dave

> http://www.claymania.com/removal-trojan-adware.html

> Multi-AV - http://www.pctipp.ch/downloads/dl/35905.asp

>

>


×
×
  • Create New...