FileSystemWatcher Not working for mapped drive

  • Thread starter Thread starter viswas p via DotNetMonster.com
  • Start date Start date
V

viswas p via DotNetMonster.com

Hi all, I am using FileSystemWatcher to monitor a mapped drive. When I run
my console application directly it works fine however when I run the exe
using Scheduler it throws uaername / password incorrect. I have tried with
both ip and mapped name for the target server, but nothing seems to work. I
have given all permissions for all the folders and even for the task.
Basically did all the necessary steps as much as I knew. Can anybody help
me regarding this.
 
When you run the app from your console you are running the app as YOU, and
you have permission to see that mapped drive.

When you run from a scheduled task (unless otherwise configured) the app is
being run as local system, which does not have permission to access the
drive.

The simplest thing to do is setup the scheduled task to run as you with your
username/password.

Having said all that, I don't believe you can have FileSystemWatcher watch a
mapped or network drive.

BW
 
Back
Top