Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Launch  Two  Applications.  Wait  Until  One  Program  Ends  and  Then  Close  the  Other  

 Content of Launch Two Applications. Wait Until One Program Ends and Then Close the Other.vbs
MD5 Hash: BCFCEE8FD82A862DA6194EA5BCB1DC26
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")

errResult = objWMIService.Create("calc.exe", null, null, intCalcID)
errResult = objWMIService.Create("notepad.exe", null, null, intNotepadID)

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colProcesses = objWMIService.ExecNotificationQuery _
("Select * From __InstanceDeletionEvent " _
& "Within 1 Where TargetInstance ISA 'Win32_Process'")

Do Until i = 999
Set objProcess = colProcesses.NextEvent
If objProcess.TargetInstance.ProcessID = intCalcID Then
Exit Do
End If
Loop

Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where ProcessID = " & intNotepadID)

For Each objProcess in colProcesses
objProcess.Terminate()
Next



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a