ASP中能否执行这样的程序?

大道如海 2003-05-12 06:25:30
Set WshShell=Server.CreateObject("Wscript.Shell")
WshShell.run "wscript something.vbs"
set WshShell=nothing
...全文
34 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
大道如海 2003-05-12
  • 打赏
  • 举报
回复
<html>
<head>
<Script language=vbscript runat=server>

Set WshShell=Server.CreateObject("Wscript.Shell")
WshShell.run "wscript.exe e:\something.vbs",1,false
set WshShell=nothing
</Script>
</head>

<body>
</body>
</html>
大道如海 2003-05-12
  • 打赏
  • 举报
回复
比如说something.vbs为如下代码
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\Shortcut Script.lnk")
oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+F"
oShellLink.IconLocation = "notepad.exe, 0"
oShellLink.Description = "Shortcut Script"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save
msgbox "OK"

执行如下asp代码
<html>
<head>
<Script language=vbscript>

Set WshShell=Server.CreateObject("Wscript.Shell")
WshShell.run "wscript.exe e:\something.vbs",1,false
set WshShell=nothing
</Script>
</head>

<body>
</body>
</html>
桌面没有生成快捷方式


——————————————
但是单独运行something.vbs
桌面可以生成快捷方式
大道如海 2003-05-12
  • 打赏
  • 举报
回复
请问你运行过吗
可以给出代码吗
为什么我会有如此错误呢
esaler 2003-05-12
  • 打赏
  • 举报
回复
可以
大道如海 2003-05-12
  • 打赏
  • 举报
回复
而且,执行的WScript.exe程序为什么不能关闭,包括手动。
大道如海 2003-05-12
  • 打赏
  • 举报
回复
似乎只执行了WScript.exe文件,却没有执行something.vbs

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧