I needed to accomplish this for some functionality that triggered Acrobat reader sessions from within Navision. I ended up writing a VB DLL with a function to kill all instances of Acrobat...obviously you just need to be careful that the user doesn't have any other valid Acrobat sessions open (I'll leave that to you to handle!). And the other downside is needing to install a DLL on each workstation. Anyway, the function itself is:
Private Function KillAcrobatSessions()
On Error GoTo FunctionErr
Dim wmi, wmiq, colProcesses, process As Object
'Kill any acrobat sessions
Set wmi = GetObject("winmgmts:")
'-- Query for active acrobat reader processes
wmiq = "select * from Win32_Process where name='AcroRd32.exe'"
Set colProcesses = wmi.ExecQuery(wmiq)
For Each process In colProcesses
process.Terminate (1)
Next
Set colProcesses = Nothing
Set wmi = Nothing
Comments
It comes with the Windows SDK toolkit.
Greetings,
...
Everybody on-line.
...
Looking good!
Private Function KillAcrobatSessions()
On Error GoTo FunctionErr
Dim wmi, wmiq, colProcesses, process As Object
'Kill any acrobat sessions
Set wmi = GetObject("winmgmts:")
'-- Query for active acrobat reader processes
wmiq = "select * from Win32_Process where name='AcroRd32.exe'"
Set colProcesses = wmi.ExecQuery(wmiq)
For Each process In colProcesses
process.Terminate (1)
Next
Set colProcesses = Nothing
Set wmi = Nothing
FunctionErr:
End Function
http://www.epimatic.com