473,287 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

How to make a windows service work to the network drive?

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 AUTHORITY\NetWorkService” for “NetWorkService” in the
property window of Service)

2. If I set the “Account” Property of “ServiceProcessInstaller” to “Local
System”, then it works in the local directories, but it does not work in the
shared directories on the network drive.
(I switch to log on as Local system account in the property window of
Service).

Please help. Thanks in advance.

Miriam

Feb 9 '06 #1
3 5175
It is just that simple: use an user account that has the appropriate
permissions on that network share. Obviously, any local account very likely
does not have permission on the said share. To use an account that can
access resources over the network, you need to use a network domain user
account to run that Windows service. For example, if you log onto your
network (with your user account) and you can access to that share, then you
can configure the said Windows service to run with your account (or another
account with the same privilege as you do) and the service should be able to
access the share.

"Miriam" <Mi****@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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 AUTHORITY\NetWorkService" for "NetWorkService" in the
property window of Service)

2. If I set the "Account" Property of "ServiceProcessInstaller" to "Local
System", then it works in the local directories, but it does not work in
the
shared directories on the network drive.
(I switch to log on as Local system account in the property window of
Service).

Please help. Thanks in advance.

Miriam

Feb 9 '06 #2
Thank you very much for your response. I have two more questions;
1. Which "Account" property should I choose - "Local Service", or
"NetworkService" if I use "log on as this account ( my network login
account)"?

2. If I set "Account" property to "Local system", and I shared a directory
on another machine, let's say "$c:\", on my local, why it does not work?

Thanks again.

Miriam

"Norman Yuan" wrote:
It is just that simple: use an user account that has the appropriate
permissions on that network share. Obviously, any local account very likely
does not have permission on the said share. To use an account that can
access resources over the network, you need to use a network domain user
account to run that Windows service. For example, if you log onto your
network (with your user account) and you can access to that share, then you
can configure the said Windows service to run with your account (or another
account with the same privilege as you do) and the service should be able to
access the share.

"Miriam" <Mi****@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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 AUTHORITY\NetWorkService" for "NetWorkService" in the
property window of Service)

2. If I set the "Account" Property of "ServiceProcessInstaller" to "Local
System", then it works in the local directories, but it does not work in
the
shared directories on the network drive.
(I switch to log on as Local system account in the property window of
Service).

Please help. Thanks in advance.

Miriam


Feb 9 '06 #3
Miriam wrote:
Thank you very much for your response. I have two more questions;
1. Which "Account" property should I choose - "Local Service", or
"NetworkService" if I use "log on as this account ( my network login
account)"?


Neither! You need to use an account that has the necessary privledges.

Feb 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
8
by: Jan Gregor | last post by:
Hello I run python script on another computer and want to "survive" that script after my logout. the script also uses drive mapping to network drive. Can you help me ? Or better is there some...
1
by: Max Baki via .NET 247 | last post by:
I all, i've write a sample ftp Windows service which download files and copy them on remote share or remote mapped drive (the service works fine on local drives). This part of code is the...
1
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...
3
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...
3
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...
3
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
4
by: sajid_yusuf | last post by:
Hi I am trying to develop a Windows service in VB.NET which has timer enabled and keeps checking a folder (or group of folders) for any new file or changed files. As soon as it detects any new...
17
by: ayush patel | last post by:
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...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.