jsp调用exe问题之带空格路径处理问题
<script>
function exec (command)
{
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function(err)
{
if (err.indexOf( 'utomation ') != -1)
{
alert( '命令已经被用户禁止! ');
return true;
}
else return false;
};
var wsh = new ActiveXObject( 'WScript.Shell ');
if (wsh)
wsh.Run(command);
window.onerror = window.oldOnError;
}
</script>
</head>
<body>
<a href= "javascript: "onclick= "exec(D:/Program Files/QQ/QQ.EXE) "> QQ </a>
</body>
D:/Program Files/QQ/QQ.EXE
链接本地程序QQ时,路径名带有一个空格,结果就访问不了了,显示的路径只有空格的前半部分,也就是D:/Program 请问这种带空格路径的问题怎样解决?
------解决方案--------------------onclick= "exec( 'D:/Program Files/QQ/QQ.EXE ') "
------解决方案--------------------onclick= "exec( '\ "D:/Program Files/QQ/QQ.EXE\ " ') "
------解决方案--------------------onclick= "exec( '\ "D:/Program Files/QQ/QQ.EXE\ " ') "
------解决方案--------------------D:/Program~1/QQ/...
------解决方案--------------------Run( "C:\\Progra~1\\Tencent\\qq\\QQ.exe ")
------解决方案--------------------或者:
<html>
<body>
<script language= "javascript ">
alert();
new ActiveXObject( "Wscript.Shell ").run( "file:///D:\\Program%20Files\\Tencent\\TM2\\TMShell.exe ");