By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,142 Members | 1,907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,142 IT Pros & Developers. It's quick & easy.

Windows Service to copy files to a Mapped Drive

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.