- Joined
- Feb 7, 2007
- Location
- Quebec, Canada
Hi there,
I got kinda tired of having to launch Steam and Xfire when ever I felt the need to play CS or any other Steam game for that matter. I decided to write a small script in order to launch Steam and Xfire at once. The script also is supposed to exit the other program once one of the two is exited. In theory my script should work, however, I can't seem to find out what is wrong. (The OS I am using is Vista)
Could someone look at my windows script?
Thank you.
I got kinda tired of having to launch Steam and Xfire when ever I felt the need to play CS or any other Steam game for that matter. I decided to write a small script in order to launch Steam and Xfire at once. The script also is supposed to exit the other program once one of the two is exited. In theory my script should work, however, I can't seem to find out what is wrong. (The OS I am using is Vista)
Could someone look at my windows script?
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
errResult = objWMIService.Create("Steam.exe", null, null, IntSteamID)
errResult = objWMIService.Create("Xfire.exe", null, null, intXfireID)
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 = intSteamID Then
Exit Do
End If
Loop
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where ProcessID = " & intSteamID)
For Each objProcess in colProcesses
objProcess.Terminate()
Next
Thank you.
Last edited: