ryadical Posted March 19, 2013 Share Posted March 19, 2013 I appologize if this is redundant but I have found some vague references in the forums for similar issues but I have not quite figured out what to do yet. I wrote a single sign on script that launches a windows based app (not web) and logs in. I setup the script to run in the background so that the user can relogin if the inactivity timer logs them out. The script launches the app via the Run() function. I would like the script to quit when the launched application closes. The problem is that the exe file that gets launched closes once the login screen is gone and a different EXE launches for the actual application. Multiple users login to the same computer (citrix server) and are not admins. I am trying to find the PID of the application it launches so that I can monitor it to see when it closes so I can close my script. I was playing with the WMI win32_process approach but the getuser method was always returning my username on pids that belnog to other users. (I copied the script directly from the forum howto) I also read that you have to be an admin to run it which is no good. I either need a good method of pulling the local users PID or an idea of a different way of knowing when to close the application. Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 If the window title of the second exe is unique then you could use function WinGetProcess to get the PID which then can be monitoried with function ProcessExists. ryadical 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
ryadical Posted March 19, 2013 Author Share Posted March 19, 2013 That is so much easier than I thought it would be. I have seen that function but I never looked into it because I did not assume it used the title of the application. Thanks for your help! Link to comment Share on other sites More sharing options...
water Posted March 19, 2013 Share Posted March 19, 2013 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki 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