View Full Version : get a handle on running powerpoint presentation

06-05-2007, 10:29 AM
Hi, I have to write up a quick something to..

1) download a .pps from an ftp server (noprobs)
2) stop the running pps presentation (stuck)
3) start the new (downloaded) version of the pps (depends on 2)

I can write a batch script to download the lastest PPS and start it with no issues , but not sure how I would close the currently running pps presentation, how would I get a handle on that in a simple batch script ?

I could use PHP to exec a process viewer and kill all pps processes but that seems really violent and I am sure there is a more elegant solution in say VB or something ... any ideas ?

06-05-2007, 11:29 AM
cool , got this one below from http://www.computerperformance.co.uk/vbscript/wmi_process_stop.htm

' ProcessKillLocal.vbs
' Sample VBScript to kill a program
' Author Guy Thomas http://computerperformance.co.uk/
' Version 2.7 - December 2005
' ------------------------ -------------------------------'
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "'calc.exe'"

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
WSCript.Echo "Just killed process " & strProcessKill _
& " on " & strComputer
' End of WMI Example of a Kill Process

06-05-2007, 05:04 PM
Another way if you don't want to kill the process, you can use this program: http://www.autohotkey.com/ To build a macro that will send the key strokes to end PowerPoint and I believe you can get it so it will select the window by the window name. And you can compile your macro into its own little exe. Might be worth looking into, its a cool program nonetheless.

06-05-2007, 05:38 PM
cool, checking it out now cheers !