CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    Germany
    Posts
    451

    Must be an easy one - percentage sign in windows command line

    I would like to pass the string "%24x" (without double quotes) to my application as a command line argument (usually referred as argv. I cannot on Windows7.

    I tried the following:
    > app.exe %24x
    --> $x
    > app.exe %%24x
    --> %$x
    > app.exe %;24x
    --> %;24x
    > app.exe "%24x"
    --> $x (so quoting does not look to change anything)

    So, how will a single percentage sign go through as an argument? How to do escaping?

  2. #2
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Must be an easy one - percentage sign in windows command line

    Code:
    "%"24x
    worked for me
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  3. #3
    Join Date
    May 2002
    Location
    Germany
    Posts
    451

    Re: Must be an easy one - percentage sign in windows command line

    Great, it does

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured