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 7404737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:17:53+00:00 2026-05-29T05:17:53+00:00

The code for the service is as follows System.Diagnostics.Process proc = new System.Diagnostics.Process(); //

  • 0

The code for the service is as follows

            System.Diagnostics.Process proc = new System.Diagnostics.Process(); // Declare New Process

            var arguments =
                String.Format("--ip {0}  --user {1} --passwd {2} --guest {3} --gpasswd {4} --action {5}",
                              controllerIPAddress, controllerUsername, controllerPassword, username, password, action);

            proc.StartInfo.Arguments = arguments;

            proc.StartInfo.FileName = "C:\\Program Files\\Netspot\\ControllerInterfaceService\\batchfile.bat";

            proc.StartInfo.RedirectStandardError = true;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.UseShellExecute = false;
            proc.StartInfo.CreateNoWindow = true;
            proc.Start();
            proc.WaitForExit();

I have a windows service that runs a dos script that calls a WGET command, all good, but I need to create and delete a temp folder using the batch script.

The problem I have is that the service is mapping the path to

  c:\windows\system32

instead of

  C:\\Program Files\\Netspot\\ControllerInterfaceService\\

This works fine within a test harness.

Any ideas on why the service uses the system32 folder instead of mapping to the local folder

  • 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-29T05:17:55+00:00Added an answer on May 29, 2026 at 5:17 am

    By default current directory for windows service is System32.

    This link might be helpfull:

    System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);

    Use the above line of code to set the current directory to the same
    directory as your windows service.

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

Sidebar

Related Questions

Just wondering, if I install a Windows service from 64-bit process (service code embedded
I have a method in my windows service as follows: System.IO.File.Copy(path, ConfigurationManager.AppSettings[BulkInsertGiftRegisterCreatorDirectory] + System.IO.Path.GetFileName(path));
We have taken over some .NET 1.1 Windows Service code that spawns threads to
So, I'm getting some compile errors on netbeans 6.5 generated web service code for
Suppose some Windows service uses code that wants mapped network drives and no UNC
I have the following code in WCF service to throw a custom fault based
I wish to code a little service where I will be able to send
I am currently writing a little bootstrap code for a service that can be
I used the following piece of code in the service to debug the service
My code calls a Web service method which takes a few minutes to perform

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.