Re: Windows Service Cannot Move Files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Watch out for using mapped drive letters. These are done on a
user-by-user basis when they log in. Try using the full network path
(like //corp_server/datadir/targetfile.txt) and see if that helps.

Tom


dermot wrote:
That isn't the problem
It uses a notify filter, for last write and then delays

This works fine using exact same code from a Windows form application
(just doesn't work when I change it to Windows Services Application).

Regards,
Dermot

tommaso.gastaldi@xxxxxxxxxxx wrote:
hi dermot

I think you are trying to get the files while they are still used by
the tcp.

You should allow some delay. When a file arrives do not assault it !

Place a timer and make an attempt every half second. You will see
some attempt will eventually succeed. Can place a limit to the number
of
attempts and log the possible unsuccesses.... let me know

-tom

dermot ha scritto:

Mike,
I actually changed the account that starts it to a domain admin
account. It can see the files (which the local system could not) -
however it cannot move the files (gets the access denied message)?

The services is running on a win 2003 server machine.
Any ideas

Regards,
Dermot


Michael D. Ober wrote:
Windows services, by default, don't have access to the network. In w2k and
XP there is a network version of the system account you can use.

Mike Ober.

"dermot" <dfrench@xxxxxxxxxxxxxxxxx> wrote in message
news:1153778884.852703.162660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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 time the windows service tries to rename the file (using
flFile.move(source,destination)) it gets an error saying access is
denied.

The files are on the network, so we though the local system account may
not have access
We tried changing the account the service uses to a domain admin, but
still got the same error.

The application runs fine as VB windows form

Any ideas, why windows service cannot do the same.

Many Thanks
Dermot French


.



Relevant Pages

  • Re: Can Service access networked computer while logged off?
    ... I think it is Yes only if the network is a workgroup. ... "Randy" wrote in message ... be it local account or domain account. ... To access files on a networkshare, you need to run the windows service with a domain account that has the permission to that networkshare. ...
    (microsoft.public.vsnet.general)
  • Re: Windows Service Cannot Move Files
    ... Are you sure that the account has write access to the directory and files? ... The windows service can see the original files, ... XP there is a network version of the system account you can use. ... The files are on the network, so we though the local system ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to make a windows service work to the network drive?
    ... use an user account that has the appropriate ... permissions on that network share. ... can configure the said Windows service to run with your account (or another ...
    (microsoft.public.dotnet.general)
  • Re: Can Service access networked computer while logged off?
    ... Windows service could be configured to run with different user account, be it local account or domain account. ... To access files on a networkshare, you need to run the windows service with a domain account that has the permission to that networkshare. ... Also the network share need to be refereed as UNC name, not as mapped network drive, which only exists with lonnged on user. ...
    (microsoft.public.vsnet.general)
  • Re: Trusted SQL Connections & NT AUTHORITYNETWORK SERVICE
    ... SYSTEM account in terms of the credentials it uses on the network. ... hitting a SQL Server on the same machine as the web app. ...
    (microsoft.public.dotnet.framework.aspnet.security)