Skip to content
process termination not working correctly in script
Got a problem with Viscosity or need help? Ask here!
I'm not sure why, but neither version of the below process termination functions work correctly when added to an killswitch script. In both versions the scripts in unresponsive and does not close qbittorrent.exe. When run as a disconnect script, the disconnecting process hangs until qbitorrent is manually terminated. Any ideas as to what could be causing this?
Code: Select all
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "'qbittorrent.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
objProcess.Terminate()
Next
WSCript.Echo "Just killed process " & strProcessKill _
& " on " & strComputer
WScript.Quit
' End of WMI Example of a Kill Process
Code: Select all
Taskkill /IM qbittorrent.exe /F
Hi n8chavez,
It sounds like an AV program may be intercepting the script, do you have any AV or Firewall software running? Do these scripts function correctly if just double clicked?
Regards,
Eric
It sounds like an AV program may be intercepting the script, do you have any AV or Firewall software running? Do these scripts function correctly if just double clicked?
Regards,
Eric
Eric Thorpe
Viscosity Developer
Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
Viscosity Developer
Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
Hi n8chavez,
Do these scripts function correctly if just double clicked?
Regards,
Eric
Do these scripts function correctly if just double clicked?
Regards,
Eric
Eric Thorpe
Viscosity Developer
Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
Viscosity Developer
Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
Yes they do. I've tried running killswitch.bat in each configs' extra configuration section using
Code: Select all
and it doesn't work, and also in the configs' disconnect script field and it doesn't work there either. Since I'm running viscosity as admin, could be version 1.8 (1627) causing the issue?route-pre-down "C:\\Program Files\\Common Files\\Viscosity\\Scripts\\KILLSWITCH.bat"
Hi n8chavez,
We've done some extensive testing and we're unable to find a problem using taskkill in a batch script. The route-pre-down script option is executed by the service, so running Viscosity as Admin will have no effect.
Please ensure you have enabled AllowOpenVPNScripts option as per - https://sparklabs.com/support/kb/article/preventing-network-and-dns-traffic-leaks/#preventing-network-leaks-when-a-drop-out-disconnect-occurs
It's possible this application has some methods in place to prevent a force kill from a user that it is not running as. I'd recommend testing your script with an application like Notepad (notepad.exe) to see if the script successfully kills it as it is an extremely simple application that will show no resistance.
Regards,
Eric
We've done some extensive testing and we're unable to find a problem using taskkill in a batch script. The route-pre-down script option is executed by the service, so running Viscosity as Admin will have no effect.
Please ensure you have enabled AllowOpenVPNScripts option as per - https://sparklabs.com/support/kb/article/preventing-network-and-dns-traffic-leaks/#preventing-network-leaks-when-a-drop-out-disconnect-occurs
It's possible this application has some methods in place to prevent a force kill from a user that it is not running as. I'd recommend testing your script with an application like Notepad (notepad.exe) to see if the script successfully kills it as it is an extremely simple application that will show no resistance.
Regards,
Eric
Eric Thorpe
Viscosity Developer
Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
Viscosity Developer
Web: http://www.sparklabs.com
Support: http://www.sparklabs.com/support
Twitter: http://twitter.com/sparklabs
7 posts
Page 1 of 1