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