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

Windows Service to copy files to a Mapped Drive

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 file or changes
(to files or folders) then it copies the files (and any new folders) to
a folder in the mapped network drive.

So far I have been successful in developing and deploying the service
which works on my local machine with two drives (C and D) and the
windows service can copy files from the source folder in C drive to D
drive successfully but when I change the destination folder to a mapped
drive on the network then it doesn't work at all. I have two computers
on the LAN in WORKGROUP mode and I have checked the permissions on the
destination folder and all look pretty fine (no firewall or anything).
I can copy the files manually to the destination folder without any
problem so why can't the windows service do.

I am really wondering what is the problem.

Please help me with this problem.

Thank you,

SY

Dec 22 '06 #1
4 11714
sa*********@yahoo.com wrote:
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 file or changes
(to files or folders) then it copies the files (and any new folders) to
a folder in the mapped network drive.
Why use a Timer? I'd use a [System.IO.]FileSystemWatcher that fires
events at your Service every time a file is updated/added/removed?
I can copy the files manually to the destination folder without any
problem so why can't the windows service do.
Services generally run under the Local System account, which can do lots
(and lots) of things on that, one machine, but knows absolutely nothing
about the network.
If you're on Windows Server 2003, use the Network Service(?) account or,
failing that, nominate a domain account and run the service under that.

HTH,
Phill W.
Dec 22 '06 #2
Aside, from what Phil W. says, I'd also say to NOT use a mapped drive in a
service context. Always use a UNC for the destination.

<sa*********@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
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 file or changes
(to files or folders) then it copies the files (and any new folders) to
a folder in the mapped network drive.

So far I have been successful in developing and deploying the service
which works on my local machine with two drives (C and D) and the
windows service can copy files from the source folder in C drive to D
drive successfully but when I change the destination folder to a mapped
drive on the network then it doesn't work at all. I have two computers
on the LAN in WORKGROUP mode and I have checked the permissions on the
destination folder and all look pretty fine (no firewall or anything).
I can copy the files manually to the destination folder without any
problem so why can't the windows service do.

I am really wondering what is the problem.

Please help me with this problem.

Thank you,

SY

Dec 22 '06 #3
Hi

I really appreciate all of you who responded to my question. I would be
obliged if someone can share code with me to simply watch a folder (on
a local machine running the service) for any changes and fire event to
copy/update a folder on the network drive.

That would be a great help.

Jeff Jarrell wrote:
Aside, from what Phil W. says, I'd also say to NOT use a mapped drive in a
service context. Always use a UNC for the destination.

<sa*********@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
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 file or changes
(to files or folders) then it copies the files (and any new folders) to
a folder in the mapped network drive.

So far I have been successful in developing and deploying the service
which works on my local machine with two drives (C and D) and the
windows service can copy files from the source folder in C drive to D
drive successfully but when I change the destination folder to a mapped
drive on the network then it doesn't work at all. I have two computers
on the LAN in WORKGROUP mode and I have checked the permissions on the
destination folder and all look pretty fine (no firewall or anything).
I can copy the files manually to the destination folder without any
problem so why can't the windows service do.

I am really wondering what is the problem.

Please help me with this problem.

Thank you,

SY
Dec 26 '06 #4
Hi

I really appreciate all of you who responded to my question. I would be
obliged if someone can share code with me to simply watch a folder (on
a local machine running the service) for any changes and fire event to
copy/update a folder on the UNC path (somewhere on the network).

That would be a great help.

Jeff Jarrell wrote:
Aside, from what Phil W. says, I'd also say to NOT use a mapped drive in a
service context. Always use a UNC for the destination.

<sa*********@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
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 file or changes
(to files or folders) then it copies the files (and any new folders) to
a folder in the mapped network drive.

So far I have been successful in developing and deploying the service
which works on my local machine with two drives (C and D) and the
windows service can copy files from the source folder in C drive to D
drive successfully but when I change the destination folder to a mapped
drive on the network then it doesn't work at all. I have two computers
on the LAN in WORKGROUP mode and I have checked the permissions on the
destination folder and all look pretty fine (no firewall or anything).
I can copy the files manually to the destination folder without any
problem so why can't the windows service do.

I am really wondering what is the problem.

Please help me with this problem.

Thank you,

SY
Dec 26 '06 #5

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

Similar topics

7
by: Anders | last post by:
Hi all, I have an console app that looks in one folder (e.g. c:\temp) and copies all files to a couple of other folders, one local folder (e.g. d:\temp) and one mounted folder (e.g. x:\). All...
5
by: Anthony Boudouvas | last post by:
Hi to all, is there a way to access a mapped network drive from a Windows Service application ? I created a very simple one, using a timer that checks for a file existance on G:\Emails (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...
5
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...
2
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...
10
by: Ruben Fdez. | last post by:
Hi, I'm in troubles with Windows XP SP_2 I've mapped a net drive to Z: for the machine user Administrator. I've build a Windows service in C# and .NET Framework 1.1. This service must copy...
10
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...
5
by: Marc | last post by:
I am trying to run a web service that has pre-compiled dll's that reference dll's that are on a mapped drive. The web service can not load because it does not see that mapped drive and returns an...
6
by: Al | last post by:
Hey all, I'm using Pycron for windows to run 5 scripts at various times of the day, all of which work well. I recently added a 6th job, a simply file copy operation, and it won't run. Once...
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: 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...
0
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,...
0
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...
0
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,...
0
jinu1996
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...
0
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...
0
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...
0
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...

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.