Windows Escape prompt

I am trying to pass a string to a Win32 program from the command line so that it prints intact.

Why do I need to run "AAA < BBB@pobox.com >" how "" "AAA < BBB@pobox.com >" ""
but
"AAA < BBB@pobox.com >", (including the comma) as the "\" AAA ^ < BBB@pobox.com ^> \ ","

I do not see consistency in escaping rules for the Windows command line

PS I'm trying to create a .cmd file

Update:

I use a simple C test program that is compiled with gcc, no additional related object files. If I replace it with perl, the rules remain the same.

I am trying to create a general screening algorithm. It will generate a .cmd file that will call perl with output redirection. I currently have a problem: if the string contains an odd number of double quotes that are escaped with a backslash, the output redirection does not work. The same problem is described in the last comment http://blogs.msdn.com/b/oldnewthing/archive/2010/09/17/10063629.aspx .

If I use "as escape for", it breaks into a space, so it will result in two parameters instead of one. Also "" has some artifacts.

+3
2

Windows . , , .

CommandLineToArgvW, , , . http://blogs.msdn.com/b/oldnewthing/archive/2010/09/17/10063629.aspx

(.. ), . , , Windows, ​​ CommandLineToArgvW, , .

, , script , .

+7

, ( ) ( """ \", ). , , < > ^ , , , - , .

+1

Source: https://habr.com/ru/post/1794164/


All Articles