473,379 Members | 1,330 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,379 software developers and data experts.

Network drive from Windows service

Hi,

I am running a .NET application as a Windows Service.
In that application I create a FileSystemWatcher.

I want it to watch a network drive which maps to an IBM iSeries IFS
directory. Every time I log in, I have to retype the password to connect
to that network drive, so it isn't stored and thus the service cannot
connect to the network drive.

How can I make the FileSystemWatcher watch that network drive? Is there
any way to provide a user/pass combination of some sort?

Thanks,
Brecht
Jan 18 '06 #1
3 2077
Your service installer should allow you to install the service with a named
user account, as long as thats a domain account it should be able to connect
to and watch a network drive share under that users credentials.

http://techrepublic.com.com/5100-351...784748-2.html#

--
Regards

John Timney
Microsoft MVP

"Brecht Yperman" <br************@nospam.invenso.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Hi,

I am running a .NET application as a Windows Service.
In that application I create a FileSystemWatcher.

I want it to watch a network drive which maps to an IBM iSeries IFS
directory. Every time I log in, I have to retype the password to connect
to that network drive, so it isn't stored and thus the service cannot
connect to the network drive.

How can I make the FileSystemWatcher watch that network drive? Is there
any way to provide a user/pass combination of some sort?

Thanks,
Brecht

Jan 18 '06 #2
John Timney ( MVP ) wrote:
Your service installer should allow you to install the service with a named
user account, as long as thats a domain account it should be able to connect
to and watch a network drive share under that users credentials.


Well, that's the problem: most iSeries's aren't aware of domains. So
most of the time you have a different password on the iSeries then on
your domain.

I guess we'll have to use unmanaged libraries (mpr.dll).

Brecht
Jan 20 '06 #3
try this, you should be able to invoke this from within your windows service
and specify a named account/password combo for connecting

http://www.codeproject.com/csharp/mapnetdrive.asp
--
Regards

John Timney
Microsoft MVP

"Brecht Yperman" <br************@nospam.invenso.com> wrote in message
news:uq**************@TK2MSFTNGP14.phx.gbl...
John Timney ( MVP ) wrote:
Your service installer should allow you to install the service with a
named user account, as long as thats a domain account it should be able
to connect to and watch a network drive share under that users
credentials.


Well, that's the problem: most iSeries's aren't aware of domains. So most
of the time you have a different password on the iSeries then on your
domain.

I guess we'll have to use unmanaged libraries (mpr.dll).

Brecht

Jan 20 '06 #4

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

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
5
by: Niloday | last post by:
Hi All, I am trying to access a mapped network drive from a service that I have created. The service needs to create/delete folders/files on a network drive. When I tried to connect to a...
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...
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...
1
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...
3
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”...
2
by: Michael | last post by:
We have an ASP.NET 2.0 web application running on a Windows 2003 domain controller. Part of that application needs to read and write files from and to a network share ( living on a MAC Xserveraid)...
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...
5
by: Phil | last post by:
A file used by my application may be stored on a shared network drive, so that it can be accessed by different people using the same application. I have written some code that uses an...
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: 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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.