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

  • SEARCH
  • Home
  • 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 8953499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:06:31+00:00 2026-06-15T14:06:31+00:00

I have built a service on a windows server 2008 R2 server that executes

  • 0

I have built a service on a windows server 2008 R2 server that executes a windows forms application. That is all working but when I want to write an error to the log on a shared network location i get the error.

But the weird thing is that when I execute the executable from the windows forms project as administrator it’s working, but when I run the service under a administrator account i get the error .

This is the code how I write to the log file
So i first try to write to L:\ and when that’s not working I write in C:\ what is working

    Try
        Using writer As StreamWriter = New StreamWriter("L:\subfolder\subfolder\log.txt", True)
            writer.WriteLine(Now & " - project started. Build 7-12-2012")
        End Using
    Catch ex As System.Exception
        Using writer As StreamWriter = New StreamWriter("c:\subfolder\log.txt", True)
            writer.WriteLine(Now & " - ERROR " & ex.ToString)
        End Using
    Finally
    End Try
  • 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-06-15T14:06:33+00:00Added an answer on June 15, 2026 at 2:06 pm

    Mapped drives are often user and session dependent, so while you are running the program on the desktop, drive L exists, but when running as a service, its likely drive L was not mapped and doesn’t exist. I suggest using the full network path, like \\servername\sharedfolder\...

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

Sidebar

Related Questions

I have a WCF client application written in VB.NET 2008 as a Windows forms
I have built software that I deploy on Windows 2003 server. The software runs
I have a windows application that acts as a WCF Service that I developed
I have a Windows service built upon ATL 7's CAtlServiceModuleT class. This service serves
I have a web service built for SharePoint 2007 that I am trying to
I have a POCO class that is mostly built through a service. I hit
Currently we have web-services built up so that everyone (with valid service account) can
I am completely confused by MS docs on Windows built-in accounts. SQL Server 2008
I have a Visual Studio 2010 Windows Forms application in which I start a
I recently built a WCF Service, and now I'm deploying it to Windows Server

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.