Network share issue from Windows service

Plug-in and third party software discussion.
Post Reply
jams
Posts: 34
Joined: Thu Mar 27, 2014 8:36 am
Contact:

Network share issue from Windows service

Post by jams » Mon Apr 27, 2020 7:32 pm

Hi,
I'm still using Everything in the complex context of a Windows service, and I now would like to support network shares.
I understood that when not executing from the user's profile one must use UNC paths instead of mapped drives.
That's what I'm currently doing, but I never get any result out of my queries.
I enabled the log file and found the following error message:

Code: Select all

2020-04-27 21:15:27.436: CreateFileW(): 1326: Failed to open file \\naspire\Photos\2010
2020-04-27 21:15:27.436: os_create_file \\naspire\Photos\2010 1326
In the ini file I have set the folders option like this:

Code: Select all

folders="\\\\naspire\\Photos\\2010"
When I run Everything (with UI) from the user's account (admin or not) I've got the expected results.
Is there a way to get out of this issue?

jams
Posts: 34
Joined: Thu Mar 27, 2014 8:36 am
Contact:

Re: Network share issue from Windows service

Post by jams » Mon Apr 27, 2020 7:41 pm

I don't have implemented a solution yet, but I may have understood the issue by myself (and the help of google).
The issue is probable a credential issue. To connect to the shared drive from my user account I had to specify credentials, but as the Windows service runs in a different session I guess it must also provide credentials. I just don't know yet how to provide them ... "net use" ?

NotNull
Posts: 2152
Joined: Wed May 24, 2017 9:22 pm

Re: Network share issue from Windows service

Post by NotNull » Mon Apr 27, 2020 7:49 pm

The account you used to run your service might not have access to the network share(s).

You can change the account in services.msc:
- double-click the servicename
- go to the Log on tab
- Enter new account and password.

EDIT:

Crosspost! Your new message came in while I was typing mine :)

jams
Posts: 34
Joined: Thu Mar 27, 2014 8:36 am
Contact:

Re: Network share issue from Windows service

Post by jams » Mon Apr 27, 2020 8:06 pm

Thanks for your answer, I have solved the issue with a command line like:

Code: Select all

net use <uncpath> /user:<login> <password>
I've been working on this a few hours already, and only after posting my question came the idea to search farther than just Everything.
The good news is that it means PhotoInsight is about to support network shares now :P

Post Reply