利用activeX控件在网页里自动登录WIN2003远程桌面并实时控制
发布时间:2009-5-18 11:04:00 | 932人感兴趣 | 人参与 | 评分:3
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>
<object classid="clsid:9059F30F-4EB1-4BD2-9FDC-36F43A218F4A" id="MsRdpClient21" CODEBASE="/tsweb/msrdp.cab" WIDTH="350" HEIGHT="200"
>
<param name="Server" value="127.0.0.1">
<param name="FullScreen" value="0">
<param name="StartConnected" value="1">
</object>
</body>
</html>
我们把上面的MsRdpClient21改名为MsTsc,把带param 的三行删除,因为我们要用脚本实现自动登录。另外CODEBASE="/tsweb/msrdp.cab"这个你自己填正确的地址,比如我的服务器giftRen.com/tsweb/msrdp.cab(只是假设,我并不提供这个下载)。在windows2003系统目录下有这个安装包。
然后我们在head段内添加如下代码(注意这里的赋值要根据你服务器的配置自己改):
Sub window_onLoad()
Document.all.MsTsc.Server = "myName"
Document.all.MsTsc.UserName = "administrator"
Document.all.MsTsc.AdvancedSettings.ClearTextPassword = "mypassword"
Document.all.MsTsc.Domain = "myDomain"
Document.all.MsTsc.Connect()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<script language="VBScript">
Sub window_onLoad()
Document.all.MsTsc.Server = "127.0.0.1" '远程服务器地址
Document.all.MsTsc.UserName = "administrator" '登录账号
Document.all.MsTsc.AdvancedSettings.ClearTextPassword = "SinaBlogShanHaiJing" '登录密码
Document.all.MsTsc.Domain = "GongAnMis" '要登录的域
Document.all.MsTsc.Connect()
End Sub
</script>
</head>
<body>
<object classid="clsid:9059F30F-4EB1-4BD2-9FDC-36F43A218F4A" id="MsTsc" CODEBASE="www.giftRen.com/tsweb/msrdp.cab" WIDTH="600" HEIGHT="500">
</object>
</body>
</html>
Display Microsoft Terminal Services ActiveX Control (or Microsoft RDP Client Control)
Updated: March 27, 2009
Applies To: Windows SBS 2008
-
Click Start, in the Search box type regedit, and then press ENTER.
Caution
Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer. -
On the User Account Control page, click Continue.
-
Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\, right-click {7584C670-2274-4EFB-B00B-D6AABA6D3850}, and then click Delete.
-
Close and restart Internet Explorer, and then try to connect to the computer by using Remote Web Workplace again. If you still get a message that says, “The Microsoft Terminal Services Client ActiveX Control (also known as Microsoft RDP Client Control) is unavailable,” proceed to step 5 to re-register the mstscax.dll file.
-
Click Start, click Run, in the Open box type %windir%\system32\regsvr32 mstscax.dll (see Figure 16), and then click OK.
-
To confirm, click OK.
-
Restart Internet Explorer, and then connect to your desktop from the remote computer by using Remote Web Workplace.
-