Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Issue with service app

2 views
Skip to first unread message

Eugene V. Goldberg

unread,
Aug 4, 2008, 10:34:34 AM8/4/08
to
I have tested with Service running on Windows 2003 Server mapping to another
Windows 2003 Server; and tested service running on Vista and trying to write
to mapped drive on XP...

"Eugene V. Goldberg" <eg...@mts-nn.ru> wrote in message
news:489711f7$1...@newsgroups.borland.com...


Eugene V. Goldberg

unread,
Aug 4, 2008, 10:28:11 AM8/4/08
to
I have a service which writes to a text file.

The problem is, it cant write to network mapped drive. No errors are
registered,
it just never writes...If i run the service under Administrator account
which has all
the priviledges, it doesnt help.

Any ideas?

Thanx,
Eugene.


Peter Below (TeamB)

unread,
Aug 4, 2008, 10:44:59 AM8/4/08
to
Eugene V. Goldberg wrote:

> I have a service which writes to a text file.
>
> The problem is, it cant write to network mapped drive. No errors are
> registered, it just never writes...If i run the service under
> Administrator account which has all the priviledges, it doesnt help.

A service runs under a user account that usually has no mapped drives
defined. Such definitions are account-specific. If your service has
network access rights (System does not have that) you can access remote
shares via UNC names or map them in code via WNetAddConnection2. You
need to do that anyway if the share requires authentication and account
used does not have direct access to it.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com

Marc Rohloff [TeamB]

unread,
Aug 4, 2008, 11:29:43 AM8/4/08
to
On Mon, 4 Aug 2008 18:28:11 +0400, Eugene V. Goldberg wrote:

> The problem is, it cant write to network mapped drive. No errors are
> registered, it just never writes...

It might help if you sort out your error handling so that it does
detect the errors. What does your writing code look like?

--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com

Remy Lebeau (TeamB)

unread,
Aug 4, 2008, 2:24:42 PM8/4/08
to

"Eugene V. Goldberg" <eg...@mts-nn.ru> wrote in message
news:489711f7$1...@newsgroups.borland.com...

> The problem is, it cant write to network mapped drive.

That problem is two-fold:

First, drive letter assignments are user-specific. The service has to
impersonate a particular user and load its Registry hive in order to access
its drive letters. Or else it has to assign its own drive letters within
its own account. Otherwise, you need to use UNC paths directly instead.

Second, services do not have any access to the network by default. The
service needs to run in a user account that has network access. Either one
of the built-in accounts, such as "NetworkService", or else use a particular
user account instead.


Gambit


Eugene V. Goldberg

unread,
Aug 4, 2008, 11:00:55 PM8/4/08
to
okay thanx alot i solved it.

"Eugene V. Goldberg" <eg...@mts-nn.ru> wrote in message

news:4897...@newsgroups.borland.com...


Donni Devito

unread,
Aug 5, 2008, 8:16:05 AM8/5/08
to
Hello everybody,
How can I give user rights to write data to another PCs shared folder like
"NetworkService".
How can I do that?

Regards.

"Eugene V. Goldberg" <eg...@mts-nn.ru> wrote in message

news:489711f7$1...@newsgroups.borland.com...

0 new messages