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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:00:22+00:00 2026-06-16T21:00:22+00:00

I have a problem starting a process in C# when there’s a space in

  • 0

I have a problem starting a process in C# when there’s a space in the path on Windows 8, even when the path is in double quotes!

The following code has been working fine for years on our XP and Windows 7 machines, but we recently switched some development boxes over to Windows 8 and we now get the following error:

'D:\Workspace\Visual' is not recognized as an internal or external command, operable program or batch file.

Code:

string command = "\"D:\\Workspace\\Visual Studio 2010\\Dev\\Tools\\Editors\\AssetManager\\bin\\Tools\\TextureAtlasBuilder.exe\"";
string arguments = "\"D:\\Local\\Temp\\xu2twc4d.cg1\" \"environment-textures\"";

ProcessStartInfo startInfo = new ProcessStartInfo
{
    CreateNoWindow = true,
    UseShellExecute = false,
    WindowStyle = ProcessWindowStyle.Hidden,
    RedirectStandardError = true,
    RedirectStandardOutput = true,
    FileName = string.Format(CultureInfo.InvariantCulture, @"{0}\cmd.exe", Environment.SystemDirectory),
    Arguments = string.Format(CultureInfo.InvariantCulture, "/C {0} {1}", command, arguments)
};

Process process = new Process
{
    StartInfo = startInfo
};

process.OutputDataReceived += new DataReceivedEventHandler(StandardOutputHandler);
process.ErrorDataReceived += new DataReceivedEventHandler(StandardErrorHandler);

process.Start();

I’ve tried literal strings with and without double quotes, verbatim strings with and without double quotes, and I always get the same error!

What am I doing wrong?!

Thanks

  • 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-16T21:00:23+00:00Added an answer on June 16, 2026 at 9:00 pm

    Remove the ” from your arguments string.

    It is tricky because the cmd behavior with /C is very strict on the use of ” as can be found out out from cmd /?. If all fails: write your commandline and arguments to a temporary cmd file and start that one…

    If /C or /K is specified, then the remainder of the command line after
    the switch is processed as a command line, where the following logic
    is used to process quote (“) characters:

    1.  If all of the following conditions are met, then quote characters
        on the command line are preserved:
    
        - no /S switch
        - exactly two quote characters
        - no special characters between the two quote characters,
          where special is one of: &<>()@^|
        - there are one or more whitespace characters between the
          two quote characters
        - the string between the two quote characters is the name
          of an executable file.
    
    2.  Otherwise, old behavior is to see if the first character is
        a quote character and if so, strip the leading character and
        remove the last quote character on the command line, preserving
        any text after the last quote character.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just starting out with JNI and I have a following problem. I
I am just starting working with jquery and have encountered the following problem <div
I have a situation where I'm starting a process in my code in order
I have a problem with starting the sunspot server. last week it worked like
I have odd problem: After starting server I got this error: undefined local variable
Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
I am starting an executable using this code: Process proc = new Process(); proc.StartInfo.FileName
My automatically starting windows service fails to start only on reboot. I have a
I have following code which on save from the admin area creates a duplicate
I'm currently solving a problem of starting external tool from .net app. I have

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.