|
-
Jan 18th, 2007, 12:28 PM
#1
Thread Starter
New Member
Killing "un-kill-able" apps with vb...
My apologies if this is in the wrong forum...
Cliff Notes Version: I want to know how to kill processes that you can't normally kill, namely "vsmon.exe" and "iclient.exe" (part of ZoneAlarm).
The challenge: Our company's remote access suite for VPNing in to our corporate network consists of four programs: iPass, Contivity VPN Client, Nortel Networks Tunnelguard, and ZoneLabs Integrity Client. These programs are required for remote access, but not every day use. When installed (standard on our current image), all four items load at startup, eating up valuable system resources. The boot times are increased dramatically. So I am attempting to write a script which I will include on our image which will Stop and Start the programs when ran, to negate the need for auto startup.
The problem: Two of the tasks, namely "vsmon.exe" and "iclient.exe" (which start when ZoneLabs Integrity Client is opened) refuse to be terminated. The only way I can get rid of them is by physically right clicking on the system tray and telling the program to close, which doesn't work too well for scripting I don't think. But I have been unsuccessful in my attempts to automate closing them.
I cannot even close these tasks in the Task Manager. It returns a dialog box: "The operation could not be completed. Access is denied." Whether the related Service ("TrueVector Internet Monitor") is started or not seems to make little difference.
I have made the following command line attempts:
tskill vsmon
- End Process failed for vsmon:Access is denied.
pskill vsmon <==== a program by SysInternals
- Unable to kill process vsmon:
- Acess is denied.
taskkill -IM vsmon.exe
- ERROR: The process "vsmon.exe" with PID 2424 could not be terminated.
- Reason: This process can only be terminated forcefully (with /F option).
taskkill -IM vsmon.exe /F
- ERROR: "The process "vsmon.exe" with PID 2424 could not be terminated.
- Reason: Access is denied.
NET STOP vsmon
- The requested pause or stop is not valid for this service.
- More help is available by typing NET HELPMSG 2191.
I have tried using the "at" command to use the task scheduler to complete the app, since this causes it to be run by the SYSTEM account (ex: at 8:23 /interactive taskkill vsmon.exe) but it does not happen. I also tried having the "at" command open the task manager and manually closing it. Still access denied.
I have tried using SendKeys to simulate the necessary keystrokes to close the app:
Code:
set wshell = CreateObject("WScript.Shell")
' "Re-open" Integrity Client so that its window will appear.
' This will start Integrity Client if it was not already running.
wshell.Exec "C:\Program Files\Zone Labs\Integrity Client\iclient.exe"
WScript.Sleep 1500 ' Gives it some time to load
' Ensures that Integrity Client is the active window
Do Until Success = True
Success = wshell.AppActivate("Zone Labs Integrity Flex")
wscript.Sleep 1000
Loop
wscript.Sleep 5000
' Right now I'm just trying to get the menu to pop up
wshell.SendKeys "%{ }"
'wshell.SendKeys "%s"
'wshell.SendKeys "%s"
'wshell.Sendkeys "{ENTER}"
set wshell = nothing
But that does not work. It's like the application completely ignores the keystrokes. Which I don't understand, since it should be the same thing as me hitting the keys manually (which DOES work). If I change the script to work with Notepad, it works like a champ. Just not with this app.
Can anyone help me with finding a way to automate closing this app? I've been working on this for a few days, but I'm a scripting n00b so perhaps I'm overlooking something. THANKS!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|