467,890 Members | 1,721 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,890 developers. It's quick & easy.

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
  • viewed: 11242
Share:
4 Replies
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Anders | last post: by
5 posts views Thread by Anthony Boudouvas | last post: by
1 post views Thread by Max Baki via .NET 247 | last post: by
10 posts views Thread by Ruben Fdez. | last post: by
10 posts views Thread by dermot | last post: by
6 posts views Thread by Al | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.