Pre-Logoff script or properly shutting down an application at shutdown..

H

Homer Simpson

I need to know how to make a pre-logoff script for XP Pro. I have a
program that must be shut down properly by exiting the program before
shutdown/logoff....

Is this possible?
 
I

Iceman

I need to know how to make a pre-logoff script for XP Pro. I have a
program that must be shut down properly by exiting the program before
shutdown/logoff....

Is this possible?

Here is a VBS script I found on the Net. The author is Marty Lindsay. This
example uses the process rsh.exe

-------

ProcessToKill = "rsh.exe"
Set WMI=GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery
("select * from Win32_Process")
For Each Process in WMI
If process.name = ProcessToKill Then
Process.terminate
End If
Next
 
A

Ayush

[Homer Simpson] wrote-:
I need to know how to make a pre-logoff script for XP Pro. I have a
program that must be shut down properly by exiting the program before
shutdown/logoff....

Is this possible?

Yes. Use the taskkill command :
TASKKILL.exe /im processname

Good Luck, Ayush.
 
I

Iceman

[Homer Simpson] wrote-:
I need to know how to make a pre-logoff script for XP Pro. I have a
program that must be shut down properly by exiting the program before
shutdown/logoff....

Is this possible?

Yes. Use the taskkill command :
TASKKILL.exe /im processname

I have no such command as 'taskkill.exe' (and I've never heard of it,
either). Or did you misspell it?
 
I

Iceman

[Iceman] wrote-:
I have no such command as 'taskkill.exe' (and I've never heard of it,
either). Or did you misspell it?

Taskkill is only available to XP Pro & Windows 2003. Are you using XP Home ?

On this computer, yes. The answer occurred to me later. Thank you for the
info an link.
 

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