Jump to content

Locked Remote Desktop script not working - (Moved)

Recommended Posts

The following code works fine with active Remote Desk Top:

ControlFocus("THRIVE PRODUCTION SERVER - Thrive", "", "Button1")

But does not work when RDP session is locked.

Thank you in advance

Link to post
Share on other sites
  • Developers

Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states:


Share your cool AutoIt scripts, UDFs and applications with others.

Do not post general support questions here, instead use the AutoIt Help and Support forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Link to post
Share on other sites

running scripts on a remote server from RDP can get complicated really quick if you have to disconnect.

This is an option I put out in the Example form, but I would suggest trying to update your script first so it only interacts directly with controls as SlackerAl suggested.  There are lots of issues interacting with windows too.


If you are able to leave the RDP session open the entire time, and it's just that the server is going to sleep, there are other options to force the server to stay active.

Edited by BigDaddyO
Link to post
Share on other sites


I tried this but it is not working, 


Func ClosePDF($hWnd, $iOnOff)
    Local Const $WM_SYSCOMMAND = 274
    Local Const $SC_CLOSE = 61808
    _SendMessage($hWnd, $WM_SYSCOMMAND, $SC_CLOSE, $iOnOff)
   If @error Then
        MsgBox($MB_SYSTEMMODAL, "_ClosePDF", "_SendMessage Error: " & @error)


Thanks again for your help.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...