Jump to content

Control automation on a server which has no session attached


Recommended Posts

Hi, I am running a script on a server (win server 2003 64bit) which has no active session attached, meaning I'm logged in, but not attached to the server via rdp.

I am using the following loop to ensure a button gets clicked when a certain app opens, but it's hit and miss. Sometimes it will click as soon as I attach to the server, even if it's been sitting for hours on end in that loop. The second it has my session attached, it clicks the button. A lot of the time it does work as expected, but it's an app that requires consistency, so needs to work 99.99% of the time.

While ControlCommand($winID, "", $RunBtnID, "IsEnabled", "") == 1
    WinActivate($winID)
    ControlClick($winID, "", $RunBtnID)
    Sleep(3000)
Wend
Link to comment
Share on other sites

You could leave the server always logged in (assuming it's in a secure room) and use VNC? Or try Run/scheduling logon.exe or combo with psexec remotely.

Also, experiment with `mstsc /console` or `mstsc /admin` from command line to access session 0. Exact switch depends on version of rdp.

Edited by ltguide
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...