Sign in to follow this  
Followers 0
prashanthi

AutoIt Remote Desktop Connection

3 posts in this topic

Hi,

May i know whether we could connect to Remote Desktop in Windows through Autoit.

If so please suggest the functions for it.

 

Thanks,

Prashanthi Pasumamula

Share this post


Link to post
Share on other sites



Just run mstsc.exe

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

If you want more than just to execute mstsc, say you need to connect to multiple machines in a business context, you could also embed the rdp client into a GUI. Something like this (barebones example):

#include <GUIConstants.au3>
 
$oRDP = ObjCreate("MsTscAx.MsTscAx")
$mGUI = GUICreate("Embedded RDP", 740, 480, -1 , -1)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 620, 460)
$comp1 = GUICtrlCreateRadio("PC 1", 635, 50, 50, 30)
$comp2 = GUICtrlCreateRadio("PC 2", 635, 90, 50, 30)
$comp3 = GUICtrlCreateRadio("PC 3", 635, 130, 50, 30)
$go = GUICtrlCreateButton("Go", 635, 440, 40, 30)
GUISetState()
 
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
  Case $msg = $go
   Select
    Case GUICtrlRead($comp1) = 1
     $oRDP.Server = "Computer1"
     $oRDP.Domain = "DOMAIN"
     $oRDP.UserName = "USERNAME"
     $oRDP.Connect()
    Case GUICtrlRead($comp2) = 1
     $oRDP.Server = "Computer2"
     $oRDP.Domain = "DOMAIN"
     $oRDP.UserName = "USERNAME"
     $oRDP.Connect()
    Case GUICtrlRead($comp3) = 1
     $oRDP.Server = "Computer3"
     $oRDP.Domain = "DOMAIN"
     $oRDP.UserName = "USERNAME"
     $oRDP.Connect()
   EndSelect
    EndSelect
WEnd
 
GUIDelete()
 
Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

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  
Followers 0