View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Antonio Antonio is offline
external usenet poster
 
Posts: 134
Default closing a remote process

I am trying to close an application running on a different network computer.

The following kills the Outlook.exe application running on Dell-650 but the
file is not closed properly and creates some problems.

Can anybody point me to information about the WBScrip. object and the
different switches and variables?

Do I have to reference any library? It works but it does not give me access
to help files.

Thanks,

Antonio

Option Explicit
Sub main()


Dim sComputer, sProcess, oShell
Const WindowStyle = 0
Const WaitOnReturn = True

sComputer = "dell-650" ' remote machine
sProcess = "outlook.exe" ' app on remote machine
Set oShell = CreateObject("WScript.Shell")
oShell.Run "TaskKill /s " & sComputer & " /im " & sProcess & " /f",
WindowStyle, WaitOnReturn
Set oShell = Nothing

End Sub