一个在HTML使用JavaScript实现调用Windows Shell.Application的例子。

本文介绍了一种通过IE浏览器使用JavaScript调用mstsc.exe实现远程桌面连接的方法,并提供了必要的IE安全设置步骤来启用此功能。

<html>

<script>

function fnShellExecuteJ()
{
var objShell = new ActiveXObject("Shell.Application");

//objShell.ShellExecute("notepad.exe", "", "", "open", 1);

objShell.ShellExecute("mstsc.exe","/v:shd-entqa-001","","",1);

}

</script>
<body>Test<br>
Click <a href="javascript: void fnShellExecuteJ()">Here to connect</a> shd-entqa-001!
</body>

</html>

客户端IE还需做一下安全设置。

If you insist on doing this, go to Tools -> Internet Options -> Security tab ->
Internet Zone -> Custom Level...

Change "Initialize and script ActiveX controls not marked as safe" to either
"Prompt" or "Enable"

A better choice might be:

Tools -> Internet Options -> Security tab -> Trusted sites Zone -> Sites...

Enter the domain name of the site you'd like the script to run from in the "Add
this Web site to the zone:" text box and click "Add". If the site is not https:,
you'll need to uncheck the "Require server verification (https:) for all sites
in this zone" checkbox before clicking "Add".

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值