Remote Desktop Manager V 2.7 -> Windows 2012 R2 Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Benk_

Remote Desktop Manager V 2.7 -> Windows 2012 R2

19 Mar 2018, 20:21

Hello,

Have connection to a remove server, want to invoke the Run command and paste a command to the remote server and hit Enter to invoke. The following works with windows 2008 R2 connection, but not with window server 2012 r2 the {ENTER} command gets redirected and invoke the "narrator settings" GUI. Any ideas?

Code: Select all

; Yes am using the SciTE4 editor to test this
IfWinActive, ahk_exe SciTE.exe
WinMinimize

; this assumes I have an active connection to server which I have and am logged in
WinActivate, ahk_exe RDCMan.exe
MouseClick, left, 200, 200 ; this is bad but does focus the Remote Desktop Session
SendInput, #r  ; Run Command invoke on the Desktop manager GOOD
Sleep, 5000
SendInput, {BackSpace} ; Clear out any content in remote session run command GOOD
Clipboard="" ; clear it
Clipboard=\\tsclient\c\ps\something.exe ; this is what I want to do
Sleep, 5000
SendInput, ^v  ; YES, have the item in the command line GOOD
Sleep, 2000
SendInput, {Enter} ; NOTHING DOING BRINGS UP NARATOR SETTINGS
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Remote Desktop Manager V 2.7 -> Windows 2012 R2  Topic is solved

20 Mar 2018, 03:10

Let's guess there are several other options to communicate with your remote box. I'd go with another kind of 'handshake'. Let's say you've established a SetTimer-routine at that box that is 'listening' 24/7 for a remote order eg via a file dropped at a shared folder, a shared INI, ... etc pp.

Code: Select all

#Persistent
SetTimer, Check,% 1000 * 60    ; check every minute
Return

Check:
    If !FileExist("<shared drive>:\<shared folder>\myHandshake.txt")    ; the handshake file should contain a valid (already manually tested) command line string at its first line.
        Return
    Else {
        FileReadLine, cmd,% "<shared drive>:\<shared folder>\myHandshake.txt", 1
        Run, % cmd,, UseErrorLevel    ; only command line driven commands. Any frontend related events (confirmation boxes etc) can't be triggered on a locked (remote) box.
        FileAppend,% A_Now . " - " . ErrorLevel . " - " . cmd . "`n",% "<shared drive>:\<shared folder>\myHandshake.log"
        FileDelete, "<shared drive>:\<shared folder>\myHandshake.txt"
        cmd := ""
        }
    Return
Not tested. I'm sure more sophisticated methods will be provided soon. Stay tuned. ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 276 guests