Hello, Bob:
On Fri, 5 Nov 2004 22:11:14 -0600: you wrote...
BS>
BS> This script sounds very helpful. Could you take me one or two steps
BS> further in terms of how to use this script? In other words, do I save
BS> this script into a file (if so, how) and then run the file, or what?
BS> Thank you. I feel like I am about to get helped and learn how to help
BS> myself all at the same time. Thanks again. Bob
BS>
Yes, save the text to a file called say, KillOutlook.vbs (The .VBS extension
is important). Then in your batch file you add a line like
cscript KillOutlook.vbs
That's all there is to using that.
Just hilight the text below then paste it into Notepad. Do a FILE | SAVE AS
and in the FILE TYPE dropdown box in the SAVE AS dialog, select ALL FILES.
Then save in the same directory as your batch file as KillOutlook.vbs
'Script starts here
set wmi = getobject("winmgmts:")
wql = "select * from Win32_Process " & " where name='outlook.exe'"
set results = wmi.execquery(wql)
for each app in results
app.terminate
next
'Script ends here
You said you are doing this on XP Pro?
If you want to stay with pure batch you could use this line in your batch
file instead of the VBS script (this for XP Pro only):
%WINDIR%\System32\taskkill.exe /F /IM OUTLOOK.EXE > nul 2>&1
This line will work in XP Pro and HE both
%WINDIR%\System32\tskill.exe outlook > nul 2>&1
Regards, Paul R. Sadowski [MVP].
--
Paul R. Sadowski
Microsoft MVP (MSN Client)
http://www.paulsadowski.com/