473,772 Members | 3,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows service problem with network drive access

63 New Member
Hi all,

I have created a windows service that has a file watcher and does some operation after it reads that file. i developed it in my local machine and installed the service on server. i have changed the file path and everythng according to server drives.

we all in the office share some network drives in which ppl will keep pasting that file and the service on server has to pick it up. which its not doing. when i paste it in netwrok drive folder it picks up and works properly. but when someone else does that service doesn't work.when i check in the server the service has stopped. i had to start it manually.

i researched alot and found that windows service donot access network drives.i tried setting up installer acount to localservice, localsystem and also network service. nothng works. should i try user? i assumed it wont work since lot of them have to use this service. also all of them have read and write permissions to the network drive.

i dont understand what am i missing here. why does the service stop for other users. it'l be gr8 if someone can throw some light on this.

Thanks
Ayush
Jul 11 '08 #1
17 3218
ayush patel
63 New Member
Hi all

let me make my question a little more clear. the windows service that i have created in my local system is installed on a server. and everyone accesss a network drive thats one of the folder in the server.

now my service works fine . but tte problem is it stops when some users use that network drive. like i put a file in that network drive it takes in, when user b puts a file it works as expected, but some user c puts a file in that network drive, it does not work and when i go in and check, the service actually stops and i have to restart the service. its wierd.

i have been reseraching for 3 days for this. this is really frustating. if anyone hasany clue pls let me know and i will research in that direction.

thanks,
Ayush
Jul 15 '08 #2
Plater
7,872 Recognized Expert Expert
Are you doing any error checking in your service? Have it print out logs of what is going on at various places in the program?
Jul 15 '08 #3
ayush patel
63 New Member
Hi,

Thanks for you repaly. I debugged the service on my local machine. there are no bugs. i cannot debug it on the server. when i checked the event log on server it says service has terminated unexpectedly.

i dont understand why is it runing for some users and not for other users. its working for the creator that is me and admin. its not working for other users. service just stops as soon as another user access that network drive.

Ayush
Jul 16 '08 #4
ayush patel
63 New Member
and also i have try catch blocks every where and it writes the error to an error file in a folder. but the problem is service is not starting at all to go to any try catch block. i have added a try catch block in the start and stop events of the service. im trying to catch the error.

if any one has anymore suggestions please help me out.

Ayush
Jul 16 '08 #5
Plater
7,872 Recognized Expert Expert
Is the service run as administrator?
Jul 16 '08 #6
ayush patel
63 New Member
No it does not run as administrator. should i have to impersonate.

Please let me know how should i make it run as an administrator.

Ayush
Jul 17 '08 #7
Plater
7,872 Recognized Expert Expert
No it does not run as administrator. should i have to impersonate.

Please let me know how should i make it run as an administrator.

Ayush
Go into services.msc and right click on your service and choose properties. On the Log On tab, change to an administrator account.
that might help?
Jul 17 '08 #8
ayush patel
63 New Member
Thanks for replying so quickly.

right now in the logon I have NT AUTHORITY\Netwo rkService as account and its password. so I should change this to admin userID and password?
Jul 17 '08 #9
Plater
7,872 Recognized Expert Expert
I'm not sure that the login credentials are even whats at fault here.
I have no idea why it can read the local share directory sometimes but not other times.
Jul 17 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2398
by: Daniel Xiao | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004 10:24:48 AM run() error: System.IO.IOException: The specified network password is not correct. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare...
3
7646
by: Daniel Xiao | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004 10:24:48 AM run() error: System.IO.IOException: The specified network password is not correct. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare...
3
13361
by: Bonj | last post by:
I need to write a windows service, and the only way it can access a shared drive on a file server on the network is if the installer is put in "User" mode - "LocalService", "LocalSystem" and "NetworkService" don't work. i.e. it can't access the shared drive. But in "User" it can. But I don't want it in user mode, if possible. I would rather it be a service. Is there any way to do it?
1
9508
by: mbah Sumani via .NET 247 | last post by:
(Type your message here) I Think it's the stupidness of Windows. Why the service can't access network drive but console apps or windows application can do it? So my suggestion is make the program for accessing network drive in console apps, then call it with your windows service.. via windows API ..he..he that should work. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As...
6
3045
by: Bijesh | last post by:
Hi All, I've developed a Windows Service that acts as a remoting server (.NET Remoting). The client(user) is able to connect to the server and start a program by giving the executable path of the program (in the server) along with the working directory and the arguments (parameters). This works fine if I try to start programs whose executable file is present witin the local drives of the server. If the application is in a netwok drive,...
5
4476
by: Nirosh | last post by:
Hi All, Can any one suggest me a best way to do this .. I have a thrid party tool "EXE" that we need to use with our web service to manipulate some complex XML files, which reside in a seperate files server. we have mapped the fodler to a different folder and need to allow the EXE to process on the mapped drive. When I trigger the EXE via web service the EXE get the permission of the launching user (mean ASP.NET user) resulting a...
2
9532
by: Dave Stewart | last post by:
I am attempting to write a vb.net windows service that will automate various file movements on my network. When I attempt to access files on a mapped drive or UNC file share, I get exceptions claiming that the file is not there. However if I copy the file path directly in to explorer it pops right up. I know that my service is running as local system and this must be causing the problems. When I write the windowsidentity.getcurrent().name...
3
5218
by: Miriam | last post by:
Hello, I created a Windows Service in VB.NET, which is to purge files periodically in the local system and also in the shared network drive. Here is my problem: 1. If I set the “Account” property of ServiceProcessInstaller to “Local Service” or to “NetWorkService”, it won’t work for both local and network shared directories. (I use log on as this account “NT AUTHORITY\LocalService” for “Local Service” or “NT...
10
4456
by: dermot | last post by:
I have wrriten a small windows service application in visual studio ..net 2003 which listens for incoming FTP files. These files would overwrite over time due to duplicate file names. However any time the windows service tries to rename the file (using flFile.move(source,destination)) it gets an error saying access is denied. The files are on the network, so we though the local system account may not have access We tried changing the...
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.