尝试获取Windows服务以在共享驱动器上运行可执行文件 [英] Trying to get a Windows Service to run an executable on a shared drive
问题描述
我有将在Windows服务中运行的C#.我正在尝试使用Process和ProcessStartInfo类来运行可执行文件.如果可执行文件在本地驱动器上,则没有问题.但是,我需要在共享驱动器上运行可执行文件.我尝试使用UNC表示法(//machine_name/share_name/directory/runme.exe),但是该过程似乎挂起了.该服务和共享驱动器在Windows XP上.有人解决过这个问题吗?
I have c# that will run in a windows service. I'm trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is on the local drive, no problem. However, I need to run an executable on a shared drive. I've tried using the UNC notation (//machine_name/share_name/directory/runme.exe), but the process seems to hang. The service and shared drive are on Windows XP. Has anyone tackled this issue before?
推荐答案
您的服务正在运行的帐户可能没有访问共享驱动器的权限.尝试将其配置为通过服务小程序以具有网络许可的用户身份运行.右键单击该服务,选择属性,然后在登录选项卡中设置帐户.
The account your service is running as likely does not have permission to access the shared drive. Try configuring it to run as a user with permission to the network via the services applet. Right click on the service, choose properties and set the account in the login tab.
这篇关于尝试获取Windows服务以在共享驱动器上运行可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!