I have a Windows service running on a local system that is simply trying to access a file with a UNC empty form \\ machine \ folder \ file.txt until it succeeds. This succeeds right away when I start the service manually, but upon rebooting it gets System Error 53 (Network Path not found) until I do something like logging out or “fiddling” using Windows Explorer , for example, by double-clicking by an unrelated text file (this is strange, I know). But there is no reliable trick; I'm not sure what makes it suddenly see a shared folder.
However, I came across a clearly reliable "solution" that was trying to create CreateProcess on "net use I: \\ machine \ folder" from the service in order to map the shared folder before trying to access it (I continue using the UNC path , not me:). The call net useappears to immediately call up my ability to access the shared folder from the service, despite the fact that the call itself net useprobably does not work (I did not check because you do not even have to display the disks from the service).
It looks like a database connection does not work when the service starts at boot, but works at startup manually , but in my case it is a network shared folder, plus I know it can also suddenly start working in the circumstances described above.
I don’t think this is an access issue because it demonstrates the full accessibility of the shared folder when it manages to gain access. But I would like to know the reason so that I can deal with it properly.
source
share