mayoroj Posted November 16, 2007 Share Posted November 16, 2007 When I am trying to kill an application I have launched through citrix using the winkill or winclose method the app closes but not for at least 10-15 seconds. Here is my code, is there something I am doing wrong? I have tried all the optional arguments I can think of but still same delay. $pid=Run('"C:\Program Files\Citrix\ICA Client\pnagent.exe" /QLaunch "testapp"') WinWait("testapp Login - \\Remote") Winkill("testapp Login - \\Remote") ; 10-15 second delay before app is killed Send("!{F4}") ; Sending the alt-F4 keystroke works right away Can Anyone tell me why there is such a delay? When I try this same code with notepad, it works right away. Link to comment Share on other sites More sharing options...
_Kurt Posted November 16, 2007 Share Posted November 16, 2007 Why not use TimerInit, calculate time & ProcessClose the Pid.. $pid=Run('"C:\Program Files\Citrix\ICA Client\pnagent.exe" /QLaunch "testapp"') $timer = TimerInit() While 1 Sleep(50) If TimerDiff($time) > 15000 Then ExitLoop WEnd ProcessClose($pid) Alot more simple.. Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 16, 2007 Share Posted November 16, 2007 When I am trying to kill an application I have launched through citrix using the winkill or winclose method the app closes but not for at least 10-15 seconds.Here is my code, is there something I am doing wrong? I have tried all the optional arguments I can think of but still same delay.$pid=Run('"C:\Program Files\Citrix\ICA Client\pnagent.exe" /QLaunch "testapp"')WinWait("testapp Login - \\Remote")Winkill("testapp Login - \\Remote") ; 10-15 second delay before app is killedSend("!{F4}") ; Sending the alt-F4 keystroke works right awayCan Anyone tell me why there is such a delay?When I try this same code with notepad, it works right away.I wonder how fast it closes if you launch the app and then close it immediately manually? There is overhead processing involved in starting up/shutting down an app, in addition to the overhead for Citrix client and the Terminal Server session. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
mayoroj Posted November 16, 2007 Author Share Posted November 16, 2007 I wonder how fast it closes if you launch the app and then close it immediately manually? There is overhead processing involved in starting up/shutting down an app, in addition to the overhead for Citrix client and the Terminal Server session. Well I can not use timer init as how the pnaagent launches the app the initial pid returned is closed out right away.The app closes out right away when you hit any buttons on it, cancel, X , or alt F4.I can find the app in task manager and kill it right away as well, isn't this what winkill is supposed to do? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now