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
17 3219
Ok. I noticed one thing the user for whom this service is not working does not have access to login to the server. he can access the network drive though.
service stops when he tries to put the file in network drive but when i restart it, it works. its not that the service does not work for him. its just that it stops. thats wierd behavior.
Plater 7,872
Recognized Expert Expert
Does your service try to do anything like examining the username of the person who put the file in the directory?
No it doesn't check any userid and password.
Plater 7,872
Recognized Expert Expert
Hmm very strange. And you're saying it never throws an access exception, like maybe when that user creates the file it gets marked with wierd privileges or something.
Could you just create an account for that user?
i have try,catch blocks everywhere even at the start and stop of the service. if an exception is caught it writes to an error file. but the problem is service just stops before going to any try catch block. the only thing that i can see in even log is that this service has stopped unexpectedly.
how can i create an account for this user?
Plater 7,872
Recognized Expert Expert
how can i create an account for this user?
Well I don't know, but you said it happens when the user with no account on the server accesses the share directory. So I figure if you get them an account so they are like everyone else, you will not see the problem?
Oh ok got it. well its a development server and not everyone should have access to it. its companies rule i cant do much about it.
if nothing works out i am planning to install the service in that users machine and change the file paths accordingly. thats my last option.
Hi,
I have got it running somehow. this is the work around i used.
if somebody access the shared drive and the service stops then i made it to restart again with in some intervel. Right click on service name and go to recovery tab in that select first failure action as restart the service. and in the service, in start action, i check for files in the the folder. therefore the service which is stopped unexpectedly will restart and if a file exists it will do what ever it has to do.
my service actually moves the file from the folder and copies it to archives after it has used it.so usually the folder is empty. so above procedure worked for me. but i wish i can figure out a better way to do this.
thanks for all you help Plater
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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?
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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();...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |