I am trying to run an application using CreateProcess. However, it doesn't seem to work with the UNC path is. I tried adding a lot of backslashes, but still cannot get it to work.
Is there any work around to it?
I tried running the command in command line, but it gives an error saying cmd does not support UNC paths.
I don't want to map the UNC path, because then the application can't run as a service.
Be careful with using UNC paths in a service if the service runs automatically at startup. Your service might try to use the UNC path before it's available unless all the relevant network services have already had time to start, you might have to set up a dependency on those.
Regarding your actual question, CreateProcess
should work with UNC paths as specifically mentioned in the documentation so without your code it's difficult to say for sure but I'd guess that it's a permission issue and that the user under whose account the service is running, might not have the correct permissions.