我在運行文件的dot net中創建了一個簡單的Windows服務。當我在本地運行服務時,我發現在任務管理器中運行的文件很好。但是,當我在服務器上運行服務時,它不會運行該文件。我檢查了文件的路徑,這很好。以下是用於啓動運行該文件的過程的代碼。有任何想法嗎?Windows服務在本地運行文件,但不在服務器上運行
protected override void OnStart(string[] args)
{
// TODO: Add code here to start your service.
eventLog1.WriteEntry("VirtualCameraService started");
// Create An instance of the Process class responsible for starting the newly process.
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
// Set the directory where the file resides
process1.StartInfo.WorkingDirectory = "C:\\VirtualCameraServiceSetup\\";
// Set the filename name of the file to be opened
process1.StartInfo.FileName = "VirtualCameraServiceProject.avc";
// Start the process
process1.Start();
}
什麼版本的windows?是否啓用UAC? – djangofan 2009-11-09 16:46:51
它是Windows Server Enterprise 2007.幾乎所有的UAC都被禁用,除了:「僅提升安裝在安全位置的UIAccess應用程序」。 「標準用戶提示提示行爲」設置爲「提示憑據」,並且「管理員批准模式下管理員提升提示行爲」設置爲「不提示提升」 – Ben 2009-11-09 17:59:00