2011-12-08 1 views
2

을 실행하지 내가 Cofdfusion 서버에서 다음 코드를 생성 testWebsite.cfmCFExecute Appcmd.exe에

<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 서비스은 도메인 사용자 인 [email protected]으로 실행 중입니다. IIS에 대해 동일한 방법을 확인하는 방법을 모르겠습니다. 그래서 월드 와이드 게시 서비스IIS 관리 서비스 - 로컬 시스템으로 실행 중을 확인했습니다. 내가 관리자로 로그인

하더라도, 나는 inetsrv를 폴더에 웹 서버 사용자을 추가 할 수 없습니다 또는 C에있는 Appcmd.exe에 : \ WINDOWS \ system32를

어떤 도움하세요 아이디어/제안.

감사합니다. Appcmd.exe에이 cmd.exe를 호출하는 경우

답변

1

그것을 작동합니다 :

<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에 대한 변수를 사용하는 것을 선호합니다.