Jump to content
Sign in to follow this  
ravi88

Remote desktop control

Recommended Posts

ravi88

Hi i am new to Autoit but i am liking it :) i come from hardawre backgrond recently thought of automating some of tasks in IXIA through remote access here is the code below

$host = "10.125.66.6" ;<<<<<<< enter here the host name or ip address

$pass = "0312016"

;Remote Desktop ActiveX Control Interfaces -> http://msdn.microsoft.com/en-us/library/aa383022(v=VS.85).aspx

$hGUI = GUICreate("RDP Embedded Sessions", 952, 675, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)

$oRDP = ObjCreate("MsTscAx.MsTscAx.2") ;http://msdn.microsoft.com/en-us/library/aa381344(v=VS.85).aspx

$oRDP_Ctrl = GUICtrlCreateObj($oRDP, 64, 44, 800, 600)

GUICtrlSetResizing(-1, $GUI_DOCKALL)

GUICtrlSetStyle($oRDP_Ctrl , $WS_VISIBLE)

$oRDP.DesktopWidth = 800

$oRDP.DesktopHeight = 600

$oRDP.Fullscreen = False

$oRDP.ColorDepth = 16

$oRDP.AdvancedSettings3.SmartSizing = True

$oRDP.Server = $host

$oRDP.UserName = "ixia" ;<<<<<<< enter here the user name

$oRDP.Domain= ""

$oRDP.AdvancedSettings2.ClearTextPassword = $pass

$oRDP.ConnectingText = "Connecting to " & $host

$oRDP.DisconnectedText = "Disconnected from " & $host

$oRDP.StartConnected = True

$oRDP.Connect()

GUISetState(@SW_SHOW, $hGUI)

;Func ixia()

;Sleep(9000)

;ShellExecute("netsh", 'interface ip set address name="Local Area Connection 2" static 192.168.255.2 255.255.255.0 192.168.1.1 1')

$oShel = ObjCreate("shell.application")

$oShel_Ctrl = GUICtrlCreateObj($oShel, 64, 44, 800, 600)

GUICtrlSetStyle($oShel_Ctrl , $WS_VISIBLE)

;Sleep(300)

Run("calc.exe")

$oShel.ShellExecute("IxExplorer.exe","","C:\Program Files\Ixia\IxOS\6.00-EA-Patch1\", "open", 1);

;EndFunc

;~ ConsoleWrite($oRDP.GetErrorDescription() & @CRLF)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

$oRDP.Disconnect()

Exit

EndSwitch

WEnd

The problem is after opening the session i am not able to perform any tasks the tasks which i intend to do gets openend in my sys itself :P

please guide me as i have serious time contraints to finish the job

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  

×