2016-05-17 34 views
3

我有一個計劃在Windows任務計劃程序中執行的C#控制檯。當我嘗試從調度程序運行它時,計劃會給我以下錯誤:C#控制檯應用程序 - 此操作需要交互式窗口站點

此操作需要交互式窗口站。

我注意到的是,這個應用程序使用一個app.manifest,以便它可以進行下面的調用:

System.Diagnostics.Process.Start("CMD.exe", <PARAM to FileZilla Server.exe /reload_config>); 

如果我參加了app.manifest出來,然後,將推出從任務調度的罰款。

如果我離開app.manifest並通過點擊應用程序運行它,它會啓動罰款。 (但不是來自任務調度程序)

回答

2

發現與此錯誤有關的東西,希望它有幫助。

The reason why Windows require the tasks to run in interactive mode is because it was suppose to show an elevated prompt prior to running the tasks itself, thanks to UAC. This is also the reason why the error only happens when the scheduled tasks are configured to run with non build-in Administrator account, by default the built-in Administrator account is configured with silent UAC policy.

To enable the silent UAC policy to non built-in Administrator account (account other than Administrator in Administrators group), open up the Properties page for the scheduled tasks, and check the Run with Highest Priveleges checkbox. This will cause the tasks to be executed as elevated a.k.a as Administrator. Case Closed.

Interactive Window Station Error On Scheduled Tasks

+0

我有檢查「與最高Preveleges運行」,但它仍然給出了同樣的錯誤。 – Arcadian

相關問題