running wsh-script on shut down or logoff
From a conversation at the discussion lounge on Win32Scripting
I want to make some action during logoff (or shutdown) process. Is it
possible to do this on W95 or NT4.0 ??
(maybe some registry editing)
The utility is called "trapsd" by "Pyzzo Software".
http://www.pyzzo.com/trapsd
Clarence
Check it out
http://cwashington.netreach.net
Win32 bit scripting. Everything you need to get up and running,
A script repository containing almost 100 sample scripts,
downloads, reference files, and technical support via an
online discussion forum.
(Pursuant to US Code, Title 47, Chapter 5, Subchapter II, 227, any and all
unsolicited commercial E-mail sent to this address is subject to a download
and archival fee in the amount of $1000 US. E-mailing denotes acceptance of
these terms.)
I believe the original post was how to launch a WSH script when a shutdown
or logout event happens.
It was not "How do I initiate a shutdown or logout from a wsh script?".
Your response answers the second item, not the intended first one.
Quote:
>Well, there are several possibilities. The most simple technique is:
>use the run-command to call the Exit-Function in Windows:
>wsh.Run ("RunDll32.exe user,ExitWindows")
>I wrote the line above out of my head, so try to enter the line in
>the Windows Run-Dialogbox first. It's important to use the spelling
>because the command "ExitWindows" is casesensitive. And you
>may don't use extra blanks.
>More description about these techniques (also how to restart
>in the following books:
>Markt & Technik: Factory - Windows 98 optimal configuriert
>MS Press: Microsoft Windows 98 Power Toolkit
>Both books are available (till yet) in German.
>For my convenience I wrote also a small ActiveX-Control allowing
>me to shutdown, restart and logoff Windows from a script calling
>the WSHExtend.quit-methode.
>This ActiveX-Control and other techniques will be available to the public
in
>Jan 99 in:
>MS Press "Inside the Windows Scripting Host"
>Currently the book is just scheduled for MS Press Germany, but
>I'm optimistic that there is enought response from Script-programmers
>to convince MS Press USA to do the project also in English ;-)
>Gnter Born
>http://ourworld.compuserve.com/homepages/Guenter_Born
>Wolf Rauch schrieb in Nachricht ...
>>Hi all,
>>how can I run a wsh-script automaticly when a user is loggin of or shuting
>>down the system?