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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:12:36+00:00 2026-05-14T01:12:36+00:00

I have an application that is supposed to aid my project in terms of

  • 0

I have an application that is supposed to aid my project in terms of pre- and post-build event handling. I’m using ndesk.options for command line argument parsing. Which gave me weird results when my project path contains spaces. I thought this was the fault of ndesk.options but I guess my own application is to blame. I call my application as a post-built event like so:

build.exe --in="$(ProjectDir)" --out="c:\out\"

A simple foreach over args[] displays the following:

--in=c:\my project" --out=c:\out"

What happened is that the last ” in each parameter was treated as if it was escaped. Thus the trailing backslash was removed. And the whole thing is treated as a single argument.

Now I thought I was being smart by simply escaping the first ” as well, like so:

build.exe --in=\"$(ProjectDir)" --out=\"c:\out\"

In that case the resulting args[] look like this:

--path="c:\my
project"
--out="c:\out"

The trailing backslash in the parameters is still swallowed and the first parameter is now split up.

Passing this args[] to ndesk.options will then yield wrong results.

How should the right command line look so that the correct elements end up in the correct args[] slots? Alternatively, how is one supposed to parse command line arguments like these with or without ndesk.options? Any suggestion is welcome.

Thanks in advance

  • 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-14T01:12:36+00:00Added an answer on May 14, 2026 at 1:12 am

    Did you try to escape the last backslash?

    build.exe --in="$(ProjectDir)\" --out="c:\out\\"
    

    This works probably only, as long as the ProjectDir ends in \, which should be given.
    This is just an idea, but I did not give it a try

    EDIT:
    I found a comment which suggests to leave out the trailing "

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

Sidebar

Related Questions

I have an application that has an area that is supposed to behave somewhat
I'm working on a web application. I have entities that are supposed to be
I have an application that is supposed to be localized (two languages, english being
I have an existing application that I'm supposed to take and create a mini
I have an application that was started in C# 1.0 using Visual Studio .NET.
I have an application that integrates with Facebook using Oauth 2. I can authorize
I have a .NET application that was supposed to be compiled as a 32-bit
I have an iPhone application that is supposed to show images inside a UIScrollView.
I have a vb.net 2008 application that is supposed to run at startup. After
I have a ASP.NET MVC web application that is supposed to be sold in

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.