|
发表于 2011-11-10 04:23:08
|
显示全部楼层
;MSTSC("192.168.1.1","20250","administrator","123456","800","600","1","15","选") ;自动连接远程桌面
;MSTSC("IP","端口","账号","密码","宽度","高度","全屏","颜色","会话") ;自动连接远程桌面
Func MSTSC($IP_MSTSC,$TCP_MSTSC,$ID_MSTSC,$MM_MSTSC,$W_MSTSC,$H_MSTSC,$QUANPING_MSTSC,$YANSE_MSTSC,$HUIHUA_MSTSC) ;自动连接远程桌面
FileDelete(@ScriptDir &"\Default.rdp") ;删除一个或多个文件.
$rdp = _
'screen mode id:i:'& $QUANPING_MSTSC & ' ' & @CRLF & _ ;窗口=1 全屏=0
'desktopwidth:i:' & $W_MSTSC & ' ' & @CRLF & _ ;宽度
'desktopheight:i:'& $H_MSTSC & ' ' & @CRLF & _ ;高度
'session bpp:i:' & $YANSE_MSTSC &' ' & @CRLF & _ ;颜色
'winposstr:s:2,3,612,172,1412,772' & @CRLF & _
'compression:i:1' & @CRLF & _
'keyboardhook:i:2' & @CRLF & _
'displayconnectionbar:i:1' & @CRLF & _
'disable wallpaper:i:1' & @CRLF & _
'disable full window drag:i:1' & @CRLF & _
'allow desktop composition:i:0' & @CRLF & _
'allow font smoothing:i:0' & @CRLF & _
'disable menu anims:i:1' & @CRLF & _
'disable themes:i:1' & @CRLF & _
'disable cursor setting:i:0' & @CRLF & _
'bitmapcachepersistenable:i:0' & @CRLF & _
'full address:s:' & $IP_MSTSC & ':' & $TCP_MSTSC & '' & @CRLF & _ ;主机IP:端口'
'audiomode:i:1 ' & @CRLF & _ ;带到这台计算机=0 留在远程计算机=1
'redirectprinters:i:0' & @CRLF & _
'redirectcomports:i:0' & @CRLF & _
'redirectsmartcards:i:0' & @CRLF & _
'redirectclipboard:i:1' & @CRLF & _
'redirectposdevices:i:0' & @CRLF & _
'drivestoredirect:s: ' & @CRLF & _ ;全盘=* 不选=留空
'autoreconnection enabled:i:1' & @CRLF & _
'authentication level:i:0' & @CRLF & _
'prompt for credentials:i:0' & @CRLF & _
'negotiate security layer:i:1' & @CRLF & _
'remoteapplicationmode:i:0' & @CRLF & _
'alternate shell:s:' & @CRLF & _
'shell working directory:s:' & @CRLF & _
'gatewayhostname:s:' & @CRLF & _
'gatewayusagemethod:i:4' & @CRLF & _
'gatewaycredentialssource:i:4' & @CRLF & _
'gatewayprofileusagemethod:i:0' & @CRLF & _
'promptcredentialonce:i:1' & @CRLF & _
'username:s:' & $ID_MSTSC & '' & @CRLF & _ ;计算机名'
' '
FileWriteLine(@ScriptDir &"\Default.rdp",$rdp) ;向此前已打开的文本文件尾追加一行数据.
If $HUIHUA_MSTSC = "选" Then ;判断会话
;存在
run('mstsc /ADMIN /edit "Default.rdp" ')
Else
;不存在
run('mstsc /edit "Default.rdp" ')
EndIf
Opt("MouseCoordMode", 0)
$title ="远程桌面连接" ;窗口标题
$text ="" ;窗口文本
WinWait($title,$text,5)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,5)
Send("{ALTDOWN}R{ALTUP}")
ControlCommand ($title,$text, "Button3","Check") ;向指定控件发送命令.
ControlCommand ($title,$text, "Button12","Check") ;向指定控件发送命令.
$title ="远程桌面连接" ;窗口标题
$text ="请输入" ;窗口文本
WinWait($title,$text,5)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,10)
Send("{ALTDOWN}R{ALTUP}")
ControlCommand ($title,$text, "Button2","UnCheck") ;向指定控件发送命令. 使目标按钮(复选框/单选框)变为非选中状态.
ControlSetText($title,$text, "Edit2", $ID_MSTSC ) ;修改指定控件的文本. 账号
ControlSetText($title,$text, "Edit3", $MM_MSTSC ) ;修改指定控件的文本. 密码
ControlCommand ($title,$text, "Button3","Check") ;向指定控件发送命令.
FileDelete(@ScriptDir &"\Default.rdp") ;删除一个或多个文件.
EndFunc ;==>MSTSC;MSTSC("192.168.1.1","20250","administrator","123456","800","600","1","15","选") ;自动连接远程桌面
;MSTSC("IP","端口","账号","密码","宽度","高度","全屏","颜色","会话") ;自动连接远程桌面
Func MSTSC($IP_MSTSC,$TCP_MSTSC,$ID_MSTSC,$MM_MSTSC,$W_MSTSC,$H_MSTSC,$QUANPING_MSTSC,$YANSE_MSTSC,$HUIHUA_MSTSC) ;自动连接远程桌面
FileDelete(@ScriptDir &"\Default.rdp") ;删除一个或多个文件.
$rdp = _
'screen mode id:i:'& $QUANPING_MSTSC & ' ' & @CRLF & _ ;窗口=1 全屏=0
'desktopwidth:i:' & $W_MSTSC & ' ' & @CRLF & _ ;宽度
'desktopheight:i:'& $H_MSTSC & ' ' & @CRLF & _ ;高度
'session bpp:i:' & $YANSE_MSTSC &' ' & @CRLF & _ ;颜色
'winposstr:s:2,3,612,172,1412,772' & @CRLF & _
'compression:i:1' & @CRLF & _
'keyboardhook:i:2' & @CRLF & _
'displayconnectionbar:i:1' & @CRLF & _
'disable wallpaper:i:1' & @CRLF & _
'disable full window drag:i:1' & @CRLF & _
'allow desktop composition:i:0' & @CRLF & _
'allow font smoothing:i:0' & @CRLF & _
'disable menu anims:i:1' & @CRLF & _
'disable themes:i:1' & @CRLF & _
'disable cursor setting:i:0' & @CRLF & _
'bitmapcachepersistenable:i:0' & @CRLF & _
'full address:s:' & $IP_MSTSC & ':' & $TCP_MSTSC & '' & @CRLF & _ ;主机IP:端口'
'audiomode:i:1 ' & @CRLF & _ ;带到这台计算机=0 留在远程计算机=1
'redirectprinters:i:0' & @CRLF & _
'redirectcomports:i:0' & @CRLF & _
'redirectsmartcards:i:0' & @CRLF & _
'redirectclipboard:i:1' & @CRLF & _
'redirectposdevices:i:0' & @CRLF & _
'drivestoredirect:s: ' & @CRLF & _ ;全盘=* 不选=留空
'autoreconnection enabled:i:1' & @CRLF & _
'authentication level:i:0' & @CRLF & _
'prompt for credentials:i:0' & @CRLF & _
'negotiate security layer:i:1' & @CRLF & _
'remoteapplicationmode:i:0' & @CRLF & _
'alternate shell:s:' & @CRLF & _
'shell working directory:s:' & @CRLF & _
'gatewayhostname:s:' & @CRLF & _
'gatewayusagemethod:i:4' & @CRLF & _
'gatewaycredentialssource:i:4' & @CRLF & _
'gatewayprofileusagemethod:i:0' & @CRLF & _
'promptcredentialonce:i:1' & @CRLF & _
'username:s:' & $ID_MSTSC & '' & @CRLF & _ ;计算机名'
' '
FileWriteLine(@ScriptDir &"\Default.rdp",$rdp) ;向此前已打开的文本文件尾追加一行数据.
If $HUIHUA_MSTSC = "选" Then ;判断会话
;存在
run('mstsc /ADMIN /edit "Default.rdp" ')
Else
;不存在
run('mstsc /edit "Default.rdp" ')
EndIf
Opt("MouseCoordMode", 0)
$title ="远程桌面连接" ;窗口标题
$text ="" ;窗口文本
WinWait($title,$text,5)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,5)
Send("{ALTDOWN}R{ALTUP}")
ControlCommand ($title,$text, "Button3","Check") ;向指定控件发送命令.
ControlCommand ($title,$text, "Button12","Check") ;向指定控件发送命令.
$title ="远程桌面连接" ;窗口标题
$text ="请输入" ;窗口文本
WinWait($title,$text,5)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,10)
Send("{ALTDOWN}R{ALTUP}")
ControlCommand ($title,$text, "Button2","UnCheck") ;向指定控件发送命令. 使目标按钮(复选框/单选框)变为非选中状态.
ControlSetText($title,$text, "Edit2", $ID_MSTSC ) ;修改指定控件的文本. 账号
ControlSetText($title,$text, "Edit3", $MM_MSTSC ) ;修改指定控件的文本. 密码
ControlCommand ($title,$text, "Button3","Check") ;向指定控件发送命令.
FileDelete(@ScriptDir &"\Default.rdp") ;删除一个或多个文件.
EndFunc ;==>MSTSC |
|