无法使用ASP从ASP页面执行cmd [英] Unable to excute a cmd using VB from ASP page
本文介绍了无法使用ASP从ASP页面执行cmd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
从ASP执行命令时遇到问题。其实我在ASP页面写了一个方法,它会打开命令prmpt并执行一个cmd。下面是代码
Hi,
I have a problem when executing a command from ASP. Actually the i wrote a method in ASP page,it will open the command prmpt and execute a cmd.The below is the code
TFS="C:\TFSGet\TFSGet\bin\Debug\TFSGet.exe"
TFSServer="http://tfs01.kenexanet.com:8080/"
pathSpec="$/KRBEnterprise/Enterprise-DEV/Application"
sScript="ComponentList"
outPath="C:\Verity"
strCmd = Chr(34) & TFS & Chr(34)
strCmd = strCmd & " /s " & Chr(34) & TFSServer & Chr(34)
strcmd = strCmd & " /p " & Chr(34) & pathSpec & Chr(34)
strCmd = strCmd & " /f " & Chr(34) & sScript & Chr(34)
strCmd = strCmd & " /o " & Chr(34) & outPath & Chr(34)
Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec(strCmd) -- Code getting hanged here.
Please suggest me with your ideas on this..
Thanks,
Kiran
推荐答案
/ KRBEnterprise / Enterprise-DEV / Application
sScript = ComponentList
outPath = C:\ Verity
strCmd = Chr( 34 )& TFS& Chr( 34 )
strCm d = strCmd& / s& Chr( 34 )& TFSServer& Chr( 34 )
strcmd = strCmd& / p& Chr( 34 )& pathSpec& Chr( 34 )
strCmd = strCmd& / f& Chr( 34 )& sScript& Chr( 34 )
strCmd = strCmd& / o& Chr( 34 )& outPath& Chr( 34 )
/KRBEnterprise/Enterprise-DEV/Application" sScript="ComponentList" outPath="C:\Verity" strCmd = Chr(34) & TFS & Chr(34) strCmd = strCmd & " /s " & Chr(34) & TFSServer & Chr(34) strcmd = strCmd & " /p " & Chr(34) & pathSpec & Chr(34) strCmd = strCmd & " /f " & Chr(34) & sScript & Chr(34) strCmd = strCmd & " /o " & Chr(34) & outPath & Chr(34)
Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec(strCmd) -- Code getting hanged here.
Please suggest me with your ideas on this..
Thanks,
Kiran
这篇关于无法使用ASP从ASP页面执行cmd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文