File query not working when vb runs as a service

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi all, I have a vb.net program running as a service that uses a network
path to query a file.

If System.IO.File.Exists(fpath & "\" & filename)

Can anyone tell me why the above isn't working? When I place it in a none
service program it works fine.


Any help appreciated.


Thanks in advance.
 
Hello Mike,

You services starts under account that has no rights to the network.
Grant this righs manually

M> Hi all, I have a vb.net program running as a service that uses a
M> network path to query a file.
M>
M> If System.IO.File.Exists(fpath & "\" & filename)
M>
M> Can anyone tell me why the above isn't working? When I place it in a
M> none service program it works fine.
M>
M> Any help appreciated.
M>
M> Thanks in advance.
M>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
Under what username do you start your service.
The default user used to start services has extremely restricted (if not
none) rights in regards of Network access.

What you could do is to define a special user for your service with the
rights you need.

- José
 
I'll try that thanks.

José Joye said:
Under what username do you start your service.
The default user used to start services has extremely restricted (if not
none) rights in regards of Network access.

What you could do is to define a special user for your service with the
rights you need.

- José
 
That was it. Thanks all for the help.


José Joye said:
Under what username do you start your service.
The default user used to start services has extremely restricted (if not
none) rights in regards of Network access.

What you could do is to define a special user for your service with the
rights you need.

- José
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top