【发布时间】:2009-11-09 16:21:09
【问题描述】:
我在 dot net 中创建了一个运行文件的简单 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?
-
它是 Windows Server Enterprise 2007。除了“仅提升安装在安全位置的 UIAccess 应用程序”之外,几乎所有内容都禁用了 UAC。 “标准用户提升提示的行为”设置为“凭据提示”并且“管理员批准模式下管理员的提升提示行为”设置为“不提示提升”