Attempting to get a Windows service to run an executable on a shared drive

I have C # that will run in a windows service. I am trying to use the Process and ProcessStartInfo classes to run an executable. If the executable is located on the local drive, no problem. However, I need to run the executable on a shared drive. I tried using UNC notation (//machine_name/share_name/directory/runme.exe), but the process seems to freeze. The service and shared drive are in Windows XP. Has anyone solved this problem before?

+3
source share
4 answers

The account on which your service is running probably does not have permission to access the shared drive. Try to configure it to run as a user with permission to access the network through the services applet. Right-click the service, select the properties, and set the account on the login tab.

+2
source

What account does the service work in?

LocalSystem will only allow access to the local file system. If you want to access a network resource, you will need to start the service as a domain or network user.

+1
source
0
source

If the application on the shared drive is a .Net application, make sure that it has sufficient trust.

0
source

Source: https://habr.com/ru/post/1697528/


All Articles