怎样在asp中远程运行服务器上的软件
例如我们想运行这个vbs脚本,则用如下命令即可,注意要设置一个当前路径。
sub chongqi() Dim WshShell set WshShell = CreateObject("wscript.Shell") WshShell.CurrentDirectory="D:\jiaoben\" '固定路径 call WshShell.Run("c:\windows\system32\cscript.exe chongqi.vbs",0,false) Set WshShell=Nothing end sub
'第二种方式 sub runMyTask() pythondir="D:\jiaoben" cmdline="c:\windows\system32\cscript.exe chongqi.vbs" set objProcess=getObject("winmgmts://./root/cimv2").Get("Win32_Process") pid=-1 : ret=-1 ret=objProcess.Create(cmdline,pythondir,,pid) set objProcess=nothing if ret<>0 then response.write "510 runfaild" end sub
下一篇: 删除过期文件的vbs脚本
目前这篇文章有1条评论(Rss)