Windows Service.
-
Hi all, I have an urgent question. I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify". When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error! I have read and tried several things but to no success :( Can anyone please assist me? :sigh:
-
Hi all, I have an urgent question. I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify". When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error! I have read and tried several things but to no success :( Can anyone please assist me? :sigh:
The network drive is mapped to a particular user (yours I presume). It is highly unlikely that you are using your user for the service, so it won't be able to see the mapping because this is not present for the user. Your choices are: 1. Rewrite your code to use the UNC path. 2. Change the user of the service to your user. 3. Add the mapping to the user that the service runs against. Option 1 is your best option (oh, and don't hardcode the value - pick it up from a config file so that you can change it later on.)
Deja View - the feeling that you've seen this post before.
-
Hi all, I have an urgent question. I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify". When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error! I have read and tried several things but to no success :( Can anyone please assist me? :sigh:
This is most likely because your service is running under the local account. A local account is just that - local. You can either configure the service to run with a specific user's credentials (I've done this and it works) or use a UNC path (I haven't tried this, so I don't know).
Cheers, विक्रम
And sleep will come, it comes to us all And some will fade and some will fall
-
The network drive is mapped to a particular user (yours I presume). It is highly unlikely that you are using your user for the service, so it won't be able to see the mapping because this is not present for the user. Your choices are: 1. Rewrite your code to use the UNC path. 2. Change the user of the service to your user. 3. Add the mapping to the user that the service runs against. Option 1 is your best option (oh, and don't hardcode the value - pick it up from a config file so that you can change it later on.)
Deja View - the feeling that you've seen this post before.
Thanx for the quick reply ;) If I use Option 1, the share uses Authentication. It's basically a DMZ share... How can I then authenticate the service? If I use Option 2, I have tried to set the Log On of the service to my domain logon, thought it would then see my mapped drive??? Under which ServiceAccount type should I install the service? Any advice here?
-
This is most likely because your service is running under the local account. A local account is just that - local. You can either configure the service to run with a specific user's credentials (I've done this and it works) or use a UNC path (I haven't tried this, so I don't know).
Cheers, विक्रम
And sleep will come, it comes to us all And some will fade and some will fall
Hi thanx for the reply! I ran the service using my domain login, I thought that this will allow the service to see MY mapped drives. But still got the same error. Under which ServiceAccount should I then install,localService, Network Service? Please assist this is of great importance :)
-
Hi all, I have an urgent question. I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify". When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error! I have read and tried several things but to no success :( Can anyone please assist me? :sigh:
Hi all, thanx for the replies. I found a way to let a windows service access a mapped drive. I knew that only the user creating the network drive can see it, so the service would have to create a mapped drive in itself.... I found this great article, just compiled the class into a dll and used it in my service. Works great, so if any one has the same problem..... http://www.codeproject.com/csharp/mapnetdrive.asp?df=100&forumid=39622&select=2248704&msg=2248704[^]
-
Hi all, I have an urgent question. I am writing an windows service to retrieve files from a network drive mapped as Y: I get the following error... Could not find a part of the path "Y:\verify". When I run an Application it works fine, so I tried to shell the exe from my service, but still get the error! I have read and tried several things but to no success :( Can anyone please assist me? :sigh:
Mapping drives is so '80s; use a UNC.
-
Mapping drives is so '80s; use a UNC.
-
Mapping drives is so '80s; use a UNC.
Mapping isnt so 80's when having to interface with DOS ;P