如何从HTML运行另一个程序

gee*_*eek 2 html javascript executable

我有以下代码片段:

<html>

<head>
<title>Example of Very First PHP Script ever!</title>
</head>

<body>
<script>
function comexe(){
C:\Program Files\Notepad++\notepad++.exe C:\Documents and Settings\User\Desktop\file.txt
}
</script>

<a href="return false;" onclick="comexe()">music</a>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

如何从HTML运行另一个程序?我究竟做错了什么?

Ada*_*son 9

根据评论中的要求添加此作为答案

你不能 - HTML是客户端,而javascript是沙箱,以保护客户端PC不受此影响.除了标题之外,您的脚本与PHP无关 - 它可以运行文件系统命令,但仅在服务器上运行.