The drive mapping belongs to the interactive logon session, the service runs
in a private logon session (even if they both are running as administrator)
and as such has no corresponding network share for drive N. The only options
you have are (preferably) to use UNC names or map the drive in your service
code.
Willy.
"Niloday" <nilodayt@rheal.com> wrote in message
news:ezqqtGq0DHA.716@TK2MSFTNGP12.phx.gbl...[color=blue]
> Hi,
>
> the mapped drive works fine when i try to access from my windows[/color]
application[color=blue]
> developed in C#, however the same does not work when i try it from windows
> service developed in C#.
>
> The main purpose for doing this is becuase the service will be running on[/color]
2[color=blue]
> different machine & will be accessing different shared folders on[/color]
different[color=blue]
> servers. So in order to avoid hard coding the network share I intend to[/color]
use[color=blue]
> a mapped network drive. Here again we do not have the option of reading[/color]
the[color=blue]
> network share from a file or database.
>
> thanks
> Niloday.
>
> "Jan Tielens" <jan@no.spam.please.leadit.be> wrote in message
> news:egrC5Ig0DHA.3140@tk2msftngp13.phx.gbl...[color=green]
> > Probably the account that you are using does not has the N: drive mapped[/color]
> to[color=green]
> > \\FS1NS\SharedDir\. I suggest you try in your code to use the UNC
> > (\\FS1NS\SharedDir\) instead of N:\Storage.
> >
> > --
> > Greetz,
> > Jan
> > __________________________________
> > Read my weblog:
http://weblogs.asp.net/jan
> > "Niloday" <nilodayt@rheal.com> schreef in bericht
> > news:uFLgvXf0DHA.548@tk2msftngp13.phx.gbl...[color=darkred]
> > > Hi All,
> > >
> > > I am trying to access a mapped network drive from a service that I[/color][/color][/color]
have[color=blue][color=green][color=darkred]
> > > created.
> > >
> > > The service needs to create/delete folders/files on a network drive.[/color][/color]
> When[color=green]
> > I[color=darkred]
> > > tried to connect to a folder on mapped network drive (eg. N:\Storage[/color][/color]
> that[color=green][color=darkred]
> > > corresponds to \\FS1NS\SharedDir\), I get an error as "Could not find[/color][/color]
> part[color=green][color=darkred]
> > > of path N:\".
> > >
> > > I tried running the service in the Administrators account but the same
> > > problem. The thing works if I directly access the network share
> > > \\FS1NS\SharedDir\.
> > >
> > > Can anybody please throw some light on whats happening here? Is there
> > > anykind of restriction on access to the mapped drives when tried from[/color][/color][/color]
a[color=blue][color=green][color=darkred]
> > > service (it did work from a C# windows application).
> > >
> > > Many thanks in advance
> > >
> > > Regds,
> > > Niloday
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]