Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 238907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:32:35+00:00 2026-05-11T20:32:35+00:00

I have a windows service set to copy files from a local directory to

  • 0

I have a windows service set to copy files from a local directory to a samba share.

The service connects via a UNC path to the server (i.e. \\remoteserver\shareddir).

I have logged in as the user under which the service is running, and was able to both copy files and create files on the samba share, using the UNC path.

However, when running the service I am getting IO exceptions that suggest a login error. I have run process monitor on that box, watching the service and I can see it finding the UNC path but getting a login error when trying to write to the share.

This is using plain vanilla .Net System.IO.File.Copy call.

I don’t understand the errors, as when logged in under the same user I am able to copy and create files on the share.

Any ideas?

Error in main processing loop (DoWork()): Logon failure: unknown user name or bad password.

System.Exception: Error on MyService.ProcessExportTransferfileDirectories and values: D:\Export, \\RemoteServer\intray, D:\Export\Archive ---> System.IO.IOException: Logon failure: unknown user name or bad password.

    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.__Error.WinIOError()
    at System.IO.File.Move(String sourceFileName, String destFileName)
    at MyService.Consumer.BusinessLogic.WmsFacade.MoveAndArchiveFile(String sourceFolder, String targetFolder, String archiveFolder, String rootFolder, LogCategory logCategory, LogCounter logCounter)
    --- End of inner exception stack trace ---
    at MyService.Consumer.BusinessLogic.WmsFacade.MoveAndArchiveFile(String sourceFolder, String targetFolder, String archiveFolder, String rootFolder, LogCategory logCategory, LogCounter logCounter)
    at MyService.Consumer.BusinessLogic.WmsFacade.ProcessExportTransfer(IDictionary`2 fileDirectories)
    at MyService.Core.TimedWorkerProvider.DoWork()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:32:35+00:00Added an answer on May 11, 2026 at 8:32 pm

    It ended up being a permissions issue – after running the service as a different user that was setup on the samba share it ran without a problem, copying files across.

    Still don’t understand why when using a different account I could copy/create files on the share using windows explorer but when the service was running under the same account it couldn’t access the share at all 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a windows service set to run at certain times, it runs first
I have a windows service that has it's name set by an app.config. I
I have a Windows service that runs as a logged-in user (local admin). During
I have a windows service. If I start it from the debugger I want
I have an windows service that monitors a folder for new files being created.when
I have a program that runs as a Windows Service which is processing files
I have a windows service running as local system, which will search for some
I have created a windows service which is set to start automatically. This service
I have a windows service installed using installutil and set to Autostart. My problem
We have a windows service created in .NET 2.0. I've set the Platform Target

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.