Jump to content
Sign in to follow this  
thrlride

issuing an enter key through mstsc.exe

Recommended Posts

thrlride

I'm trying to come up with a script that will send an enter keystroke through a logged in mstsc.exe (remote desktop) session to a TSO instance on a mainframe. This will basically keep the TSO session logged in. Is there a way I can do this with autoit installed on my home computer?

Share this post


Link to post
Share on other sites
BinaryBrother

Did you even try? :)

Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("xxx.xx.xxx.xx - Remote Desktop Connection","xxx.xx.xxx.xx - Remo")
If Not WinActive("xxx.xx.xxx.xx - Remote Desktop Connection","xxx.xx.xxx.xx - Remo") Then WinActivate("xxx.xx.xxx.xx - Remote Desktop Connection","xxx.xx.xxx.xx - Remo")
WinWaitActive("xxx.xx.xxx.xx - Remote Desktop Connection","xxx.xx.xxx.xx - Remo")
MouseMove(583,404)
MouseDown("left")
MouseUp("left")
Send("{ENTER}")

I simply opened RemoteDesktop connected to one of my servers, and used Au3 recorder... Yes, there are better ways... but here is a quick and dirty snippet to get you started... :)

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.