Jump to content
Sign in to follow this  
willj

Terminal Server script

Recommended Posts

willj

I wrote a script that starts an application and then using the ProcessWaitClose upon closure of the app the I run the logoff command. The script is run via GPO at logon. This worked great in testing. Now having several users running this at one time and it quit working. Troubleshooting I found that the Process WaitClose was looking at the first instance of the application on the TS. Since it was not closed the logoff never happened. (Verified this by grabbing process id). I am trying to figure out how to get the command to look at the correct process id. Thoughts?

Share this post


Link to post
Share on other sites
CodyBarrett

Share this post


Link to post
Share on other sites
ResNullius

I wrote a script that starts an application and then using the ProcessWaitClose upon closure of the app the I run the logoff command. The script is run via GPO at logon. This worked great in testing. Now having several users running this at one time and it quit working. Troubleshooting I found that the Process WaitClose was looking at the first instance of the application on the TS. Since it was not closed the logoff never happened. (Verified this by grabbing process id). I am trying to figure out how to get the command to look at the correct process id. Thoughts?

Are you returning a PID from the launch of the application to use with ProcessWaitClose()?

Or just trying with the process name? Using the PID should work.

If not, you might want to look at MrCreatoR's _ProcessCloseByOwner() function:

http://www.autoitscript.com/forum/index.ph...st&p=312935

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.