簡體   English   中英

CFExecute不執行appcmd.exe

[英]CFExecute not executing appcmd.exe

我在Cofdfusion服務器上創建了以下代碼:文件名:testWebsite.cfm

<cfoutput>
<cfset exec_command = "add site /name:""demosite"" /bindings:http://demosite.testserver.com:80 /physicalpath:""D:\Websites\demosite"" ">

<cfexecute name="C:\Windows\System32\inetsrv\appcmd.exe" arguments="#exec_command#" timeout="60" />

Done!
</cfoutput>

但是當我執行此文件時,例如http://www.demoserver.com/testcases/testWebsite.cfm

它僅顯示“完成!” 沒有任何錯誤,它不會執行添加站點代碼。

查閱大量文檔后,我檢查了執行兩個文檔的用戶權限。 Coldfusion服務以域用戶Webserver@domain.com的身份運行,我不知道如何檢查IIS。 因此,我檢查了World Wide Publishing服務IIS Admin Service (作為本地系統運行)。

即使以管理員身份登錄,也無法將Web服務器用戶添加到inetsrv文件夾或位於C:\\ Windows \\ System32的appcmd.exe中

請幫助任何想法/建議。

謝謝。

如果從cmd.exe調用了appcmd.exe,它將正常工作:

<cfset vcCmdPath = "C:\Windows\system32\cmd.exe">
<cfset vcAppCmdArg = "/c C:\Windows\System32\inetsrv\appcmd.exe">
<cfset exec_command = "add site /name:""demosite"" /bindings:http://demosite.testserver.com:80 /physicalpath:""D:\Websites\demosite"" ">

<cfexecute name="#vcCmdPath#" arguments="#vcAppCmdArg# #exec_command#" variable="vcAppCmdResults" timeout="60"></cfexecute>

<cfoutput>#vcAppCmdResults#</cfoutput>

我更喜歡為cmd.exe和appcmd.exe使用變量。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM