![](/img/trans.png)
[英]How to overcome batch file execution part way through when using CFExecute with PsExec to run Git actions?
[英]Executing a batch file using CFEXECUTE
我嘗試使用 cfexecute 運行 test.bat 文件。 加載一段時間后顯示超時錯誤。 輸出文件為空。 但是當我雙擊 test.bat 文件時它工作正常。 我的代碼是這樣的
<cfexecute name="C:\Windows\System32\cmd.exe" arguments="/C C:\ColdFusion2018\cfusion\wwwroot\test.bat" timeout="60" outputfile="C:\ColdFusion2018\cfusion\wwwroot\log_output1.txt"></cfexecute>
我們建議使用CFX_EXEC (Windows) 而不是內置的 CFExecute。 在運行 BAT 文件時,我們遇到過很多情況,需要在具有不同於 CF 服務的權限的單獨 Windows 帳戶下運行它。 CFX_EXEC 使我們能夠指定特定帳戶,而 CFExecute 根本沒有選項。 我們還使用 CFX_EXEC 來執行 IP/DNS 查找,因為它比 Java 快得多,遵守 TTL 並且不會“永遠”緩存查找結果。
如果要使用 cfexecute 運行 test.bat,則 test.bat 應該是 name 屬性的值,而不是 arguments 屬性。
<cfexecute name="C:\ColdFusion2018\cfusion\wwwroot\test.bat"
timeout="60"
arguments ="whatever applies"
outputfile="C:\ColdFusion2018\cfusion\wwwroot\log_output1.txt">
</cfexecute>
感謝您的答復,
在命令行中取消“按任意鍵繼續..”(暫停)后,批處理文件成功執行。 它使 cfexecute 加載直到超時。 這就是這里的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.