0

Is there a way to make Visual Studio expand * in file names (and directory names) before invoking the debugger? When I write, e.g., *.txt as the command line arguments, the args[] variable will contain just one entry ("*.txt"), rather than one entry for each matching file. Do I have to write my own code to do this expansion?

2
  • That's a pretty infamous Unix shell feature. It is completely absent in Windows, in VS as well. Commented Nov 4, 2014 at 16:22
  • Well, it works in cmd, so it's not completely absent. Anyway, I solved it by simply creating a list of all the files I needed, and assigning the list to args at the beginning of my debugging session. But it's kind of fiddly, and such an obvious thing that VS should support IMHO. Commented Nov 5, 2014 at 7:47

1 Answer 1

1

If you are invoking visual studio as such:

devenv /debugexe 'myprogram' *.txt

then yes, args[] will contain '*.txt' and you will need to parse and respond to that in your program. (Just the same as if you'd launched the program without the debugger).

Sign up to request clarification or add additional context in comments.

1 Comment

Actually, no, I invoke the debugger by hitting F5, after entering the arguments under "Project properties" -> "Debug" -> "Command Line Arguments". And I do not surround them with quotation marks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.