.Net console apps and \"

I discovered something weird with .Net console apps.  Say I have an app called testapp and want to run it from a command line like this:

C:\>testapp /s Server /f "C:\testfolder\testfile\" >output.txt

That won't work the way you might expect it to.  The framework doesn't treat \" (backslash followed by a double quote) the way it should (in my opinion) and so the last argument is "C:\testfolder\testfile\" >output.txt

I just throw up a message in my app telling the user not to end the path with \", for lack of a better solution.  Thanks to Jon Galloway for this:  http://weblogs.asp.net/jgalloway/archive/2006/09/13/Command-Line-Confusion.aspx&;title=Command+Line+Confusion

Print | posted on Friday, December 08, 2006 5:00 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)
 
Please add 7 and 6 and type the answer here: