Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Manually recombining them is hard:</strong></p> <p>You could try to re-combine them, I think it would work, but be sure to following <a href="http://msdn.microsoft.com/en-us/library/17w5ykft.aspx" rel="nofollow noreferrer">the same command line escaping rules that windows has</a>. This could be more than the trivial solution you're looking for. </p> <p>Also if there are any parameters that have spaces in them, then you would want to join them to the string with quotes around them. Here is an example of a strange escaping rule: if you have --folderpath <code>"c:\test\"</code> then the last backslash has to be doubled --folderpath <code>"c:\test\\"</code>.</p> <p><strong>If you are using MFC:</strong></p> <p>You can can get the value you want from your derived CWinApp's theApp.m_lpCmdLine. Note you could still access them the other way too with __argc, and __argv or <a href="http://msdn.microsoft.com/en-us/library/bb776391(VS.85).aspx" rel="nofollow noreferrer">CommandLineToArgvW</a>.</p> <p><strong>If you are using Win32 only (even without a GUI):</strong></p> <p>You can get it from <a href="http://msdn.microsoft.com/en-us/library/ms633559(VS.85).aspx" rel="nofollow noreferrer">WinMain</a>. Which can be your program's entry point. </p> <p>Note you could still access them the other way too with __argc, and __argv or <a href="http://msdn.microsoft.com/en-us/library/bb776391(VS.85).aspx" rel="nofollow noreferrer">CommandLineToArgvW</a>.</p> <p><strong>If you must use a console based application with main or wmain:</strong></p> <p>The Win32 API <a href="http://msdn.microsoft.com/en-us/library/ms683156%28VS.85%29.aspx" rel="nofollow noreferrer">GetCommandLine</a> seems to be the way to go. You would need to still parse this to get past the .exe name though. Take into account quotes around the exe name/path too. If there are no such quotes at the start, then just go to the next space for the start.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload