尝试获取Windows服务以在共享驱动器上运行可执行文件 [英] Trying to get a Windows Service to run an executable on a shared drive

查看:83
本文介绍了尝试获取Windows服务以在共享驱动器上运行可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有将在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆