473,385 Members | 1,873 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,385 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 5179
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.