News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Get Commandline args

Started by ragdog, November 01, 2011, 07:12:57 PM

Previous topic - Next topic

ragdog

Hi

I need for my new Project a commandline switch function

Example:

Tool.exe /Read "c:\folder\test.txt"

With GetCommandLine ,PathGetArgs can i get the cmd switch and quoted path
to a Buffer >  /Read "c:\folder\test.txt" <
Must i parse the cmd switch?

Or gives a other Windows api as "CommandLineToArgvW" to get the cmd switches?

example
CommandLineToArgvA

Greets,

Vortex

Hi ragdog,

CommandLineToArgvW is an option. Also, you can have a look at the Command Line Procedures provided with the masm32 static library.

dedndave

open the help file
\masm32\help\masm32lib.chm

in the Contents...
Command Line

there are 4 functions
ArgCl
ArgClC
GetCl
getcl_ex

open the help file
\masm32\help\hlhelp.chm

i see 1 macro under Macro Catagories, String Macros
cmd$ - which will retrieve individual arguments

sinsi

Light travels faster than sound, that's why some people seem bright until you hear them.

jj2007

Quote from: Vortex on November 01, 2011, 07:17:51 PMCommandLineToArgvW is an option.

Apparently it's a bit messy, the top Google hits for CommandLineToArgvW are not that positive. I am using GetCommandLineW for the MB wCL$() macro, example here. However, if I read the initial post right, ragdog is not really interested in Unicode...