Board index » cppbuilder » Windows Service with network drive accessiblility

Windows Service with network drive accessiblility


2007-07-17 02:41:15 AM
cppbuilder61
Hello,
I'm using BDS 2006. I created a C++ Windows Service which is working fine,
but I can't get it to see a network drive. I've tried with a mapped drive
letter and with the full server\share name. I know the Local System account
doesn't have enough rights so I tried other accounts with no luck. I also
can't figure out how to use the Nework Service account. Any help will be
greatly appreciated.
Thanks,
Israel Lugo
 
 

Re:Windows Service with network drive accessiblility

"Israel Lugo" < XXXX@XXXXX.COM >wrote in message
Quote
I created a C++ Windows Service which is working
fine, but I can't get it to see a network drive.
That is because a service runs under the SYSTEM account by default, which
does not have any access to the network at all.
Quote
I know the Local System account doesn't have enough
rights so I tried other accounts with no luck.
What exaclty did you try? Please be more specific.
There is a built-in NetworkService account that allows a service to access
the network.
Quote
I also can't figure out how to use the Nework Service account.
Did you try specifying it in the service's ServiceStartName property?
Again, what exactly did you try?
Gambit
 

Re:Windows Service with network drive accessiblility

OK, I need to create a windows service (in C++ Builder 2006) that reads a
file on a network drive; and if possible, also to be interactive with the
desktop.
I tried using the NetworkServive account in the ServiceStartName property,
no luck, what would the password be?
If anyone could just respond with a quick little step by step procedure, it
would be great. Thanks.
Israel Lugo
WLT Software of Florida
XXXX@XXXXX.COM
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Israel Lugo" < XXXX@XXXXX.COM >wrote in message
news:469bbbcc$ XXXX@XXXXX.COM ...

>I created a C++ Windows Service which is working
>fine, but I can't get it to see a network drive.

That is because a service runs under the SYSTEM account by default, which
does not have any access to the network at all.

>I know the Local System account doesn't have enough
>rights so I tried other accounts with no luck.

What exaclty did you try? Please be more specific.

There is a built-in NetworkService account that allows a service to access
the network.

>I also can't figure out how to use the Nework Service account.

Did you try specifying it in the service's ServiceStartName property?
Again, what exactly did you try?


Gambit


 

{smallsort}

Re:Windows Service with network drive accessiblility

"Israel Lugo" < XXXX@XXXXX.COM >wrote in message
Quote
OK, I need to create a windows service (in C++ Builder 2006)
that reads a file on a network drive; and if possible, also to be
interactive with the desktop.
Then you must use a network-enabled user account for the service.
Quote
I tried using the NetworkServive account in the ServiceStartName
property, no luck
That is not what I asked. What is the EXACT string value that you put in?
You did not try to put in "NetworkService" by itself, did you? That won't
work, and is not what Microsoft's documentation says to use anyway. You
have to fully qualify it with the proper domain, ie:
"NTAUTHORITY\NETWORKSERVICE"
Note that the built-in service accounts, other than the SYSTEM account, only
work on XP and later. If you need to support NT4 or W2K, you will have to
create your own user account with network priviledges.
Quote
what would the password be?
Nothing.
Gambit
 

Re:Windows Service with network drive accessiblility

Remy,
It's working, this was the info I needed. Thanks for all the help.
Israel
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote

"Israel Lugo" < XXXX@XXXXX.COM >wrote in message
news:469be8fb$ XXXX@XXXXX.COM ...

>OK, I need to create a windows service (in C++ Builder 2006)
>that reads a file on a network drive; and if possible, also to be
>interactive with the desktop.

Then you must use a network-enabled user account for the service.

>I tried using the NetworkServive account in the ServiceStartName
>property, no luck

That is not what I asked. What is the EXACT string value that you put in?
You did not try to put in "NetworkService" by itself, did you? That won't
work, and is not what Microsoft's documentation says to use anyway. You
have to fully qualify it with the proper domain, ie:

"NTAUTHORITY\NETWORKSERVICE"

Note that the built-in service accounts, other than the SYSTEM account,
only
work on XP and later. If you need to support NT4 or W2K, you will have to
create your own user account with network priviledges.

>what would the password be?

Nothing.


Gambit