Jump to content
Sign in to follow this  
dplaut

Is user running app via remote desktop

Recommended Posts

dplaut

Is it possible to determine if the user running a script is running that script in a remote desktop session?

Reason:

I have a script that saves its screen position. When user is logged in via remote desktop the screen resolution is different and the window might open outside of the viewable area. I guess this could also be handled by determining a change in screen resolution from the last time app was run but I don't know how to do that either.

Share this post


Link to post
Share on other sites
dplaut

I am not sure,

Did you search google?

Yes, but it is hard to word a useful query because so many hits try to teach how to "use remote desktop" etc. I searched this forum, too.

I know IE knows when you are remoting in because I have a dual monitor setup at work. IE displays in monitor 2 at work. If I remote in it displays in monitor one. Not all programs make that adjustment.

Share this post


Link to post
Share on other sites
dplaut

Looks like it might be:

hkey_current_user, Volatile environment, session name.

If session name has w/ rdp in the name instead of "console" that might indicate user is in via remote desktop.

Can anyone confirm?

Share this post


Link to post
Share on other sites
dplaut

Here is how to check if user is logged in via Remote Deskto:

;======================================

;Determine if this a remote session

;================================ =====

$bRemoteSession = 0

$strSessionName = RegRead("HKEY_Current_User\Volatile Environment", "SessionName")

$result = StringInStr($strSessionName, "RDP")

if $result > 0 Then

$bRemoteSession = 1

EndIf

Edited by dplaut

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.