本帖最后由 lpxx 于 2017-1-12 22:54 编辑
最早发布在ACC论坛的,供你参考
刚好偶尔翻到的代码,很多东西已经想不起来了。#include <GUIConstants.au3>
#include <WindowsConstants.au3>
$oRDP = ObjCreate("MsTscAx.MsTscAx")
GUICreate("au3远程桌面连接测试", 640, 480, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 620, 460)
GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )
GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO)
GUISetState()
$oRDP.Server = "192.168.1.200" ;IP
$oRDP.Domain = "" ;登录域
$oRDP.UserName = "guest" ; 用户名
$oRDP.AdvancedSettings2.ClearTextPassword = "demo888" ; 密码
$oRDP.FullScreen = False ; 全屏是/否
$oRDP.AdvancedSettings2.RedirectDrives = True ; 本地设备和资源是否被带到远程会话中
$oRDP.AdvancedSettings2.RedirectPrinters = False ; 打印机
$oRDP.AdvancedSettings2.RedirectPorts = False ; LPT1等端口
$oRDP.AdvancedSettings2.RedirectSmartCards = False ; 智能卡身份验证
$oRDP.ConnectingText = "正在在连接 ...." ;
$oRDP.AdvancedSettings2.EnableAutoReconnect = True
$oRDP.AdvancedSettings2.allowBackgroundInput = true
$oRDP.AdvancedSettings2.ConnectionBarShowRestoreButton = False
$oRDP.AdvancedSettings5.AudioRedirectionMode = 0
$oRDP.Connect()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
GUIDelete()
Exit
回复 7# ipmitool |