Sign in to follow this  
Followers 0
ryadical

Finding processes for users

4 posts in this topic

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.

Share this post


Link to post
Share on other sites

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.

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
:D

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0