Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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?

Posted (edited)

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

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
×
×
  • Create New...