|
|
ShowParams.exe (written in c) |
---|
>ShowParams.exe "c:\test a\" "c:\test b\"
param 0 = ShowParams.exe param 1 = c:\test a" c:\test param 2 = b" |
C#ShowParams.exe (written in C#) |
---|
>C#ShowParams.exe "c:\test a\" "c:\test b\"
There are 2 program arguments c:\test a" c:\test b" |
ShowParams.bat (a batch file) |
---|
>ShowParams.bat "c:\test a\" "c:\test b\"
param 1 = "c:\test a\" param 2 = "c:\test b\" |
ShowParams.vbs (a Visual Basic script) |
---|
>ShowParams.vbs "c:\test a\" "c:\test b\"
param 0 = c:\test a\ param 1 = c:\test b\ |
|
|
|
msvcr120.dll | — | Visual C++ 2013 | — | (VC++ 12.0) | — | (released on October 17, 2013) |
msvcr110.dl | — | Visual Studio 2012 | — | (VC++ 11.0) | ||
msvcr100.dll | — | Visual Studio 2010 | — | (VC++ 10.0) | ||
msvcr90.dll | — | Visual Studio 2008 | — | (VC++ 9.0) | — | [new command line parsing] |
msvcr80.dll | — | Visual Studio 2005 | — | (VC++ 8.0) | ||
msvcr71.dll | — | Visual C++ .NET 2003 | — | (VC++ 7.1) | ||
msvcr70.dll | — | Visual C++ .NET 2002 | — | (VC++ 7.0) | ||
msvcrt.dll | — | Visual C++ 6.0 | — | (VC6) |
Use | " | to start/end a double quoted part |
Use | \" | to insert a literal " |
Use | \\" | to insert a \ then start or end a double quoted part |
Use | \\\" | to insert a literal \" |
Use | \ | to insert a literal \ |
Command-Line |
argv[1] |
Comment |
---|---|---|
CallMeIshmael |
CallMeIshmael |
a plain parameter can contain any characters except {space} {tab} \ " |
┌───────────────┐
|
|
|
┌──────┐
|
|
|
CallMe\"Ishmael
|
CallMe"Ishmael
|
|
┌───────────────┐
|
|
|
┌─────────────────┐
|
|
|
┌─────────────────┐
|
|
|
a\\\b |
a\\\b |
backslashes not followed immediately by a double quotation mark are interpreted literally |
"a\\\b" |
a\\\b |
whether or not the backslashes are in a double quoted part |
Command-Line |
argv[1] |
Comment |
---|---|---|
┌───────────────────┐
|
|
|
┌───────────┐
|
|
|
┌───────────────┐
|
|
|
Command-Line Input |
argv[1] |
argv[2] |
argv[3] |
Comment |
---|---|---|---|---|
┌─────┐ |
┌─────┐ |
|
|
|
┌─────┐ ┌──┐ |
┌────┐ |
┌─┐ |
|
\" → " |
↓ ┌───┐ ↓ |
|
↓ ↓ |
|
backslashes not followed immediately by a double quotation mark are interpreted literally
|
a\\\"b c d |
a\"b |
c |
d |
2n+1 backslashes before " → n backslashes + a literal " |
┌───┐↓ ↓ |
|
|
|
2n backslashes followed by a " produce n backslashes + start/end double quoted part.
|
Command-Line Input |
argv[1] |
argv[2] |
argv[3] |
argv[4] |
argv[5] |
Comment |
---|---|---|---|---|---|---|
┌─────── |
|
|
||||
┌─────────────────┐
|
|
|
|
|
||
┌───────────────────┐
|
|
|
||||
┌──┐ ┌┐
|
|
|
|
|
|
|
Command-Line Input |
argv[1] |
argv[2] |
argv[3] |
Comment |
---|---|---|---|---|
┌─────┐ |
|
"" while in a double quoted part → end double quoted part and accept 2nd " literally |
||
┌┐ ┌┐
|
|
|
|
" Begin double quoted part. |
┌┐ ↓ ↓ ┌┐
|
|
|
|
Parameters are delimited by spaces or tabs. |
┌┐ ┌───────────────┐
|
|
|
|
Parameters are delimited by spaces or tabs. |
How triple double quotes are parsed (post 2008) |
---|
..."""Call Me Ishmael"""...
>ShowParams.exe """Call Me Ishmael"""
an alternative method is ┌───────────────┐ or ┌───────────────────┐ |
How triple double quotes were parsed (pre 2008) |
---|
..."""Call Me Ishmael"""...
>ShowParams.exe """Call Me Ishmael"""
an alternative method is >ShowParams.exe \"Call Me Ishmael\"
|
How quadruple double quotes are parsed(post 2008) |
---|
...""""Call me Ishmael""""...
>ShowParams.exe """"Call Me Ishmael""""
an alternative method is >ShowParams.exe \"Call Me Ishmael\"
|
How quadruple double quotes are parsed (pre 2008) |
---|
...""""Call me Ishmael""""...
>ShowParams.exe """"Call Me Ishmael""""
Note quotes #7,#8 are not necessary. They contribute nothing. >ShowParams.exe """"Call Me Ishmael""
an alternative method is >ShowParams.exe "\"Call Me Ishmael\""
|
1. | Parse off parameter 0 (the program filename) | ||||||
• | The entire parameter may be enclosed in double quotes (it handles double quoted parts) (Double quotes are necessary if there are any spaces or tabs in the parameter) | ||||||
• | There is no special processing of backslashes (\) | ||||||
2. | Parse off next parameter: | ||||||
a. | Skip over multiple spaces/tabs between parameters | ||||||
LOOP | |||||||
b. | Count the backslashes (\). Let m = number of backslashes. (m may be zero.) | ||||||
IF even number of backslashes (or zero) | |||||||
c. | IF next character following m backslashes is a double quote: | ||||||
Even number of backslashes? | |||||||
Yes. If we're not in a double quoted part, " begins a double quoted part. | |||||||
Yes. If we're in a double quoted part, "" skip 1st take 2nd " | |||||||
If m is even (or zero) | |||||||
if currently in a double quoted part | |||||||
IF next character is also a " | |||||||
move to next character (the 2nd ". This character will be added to the parameter.) | |||||||
ELSE | |||||||
set flag to not add this " character to the parameter | |||||||
toggle double quoted part flag (end double quoted part) | |||||||
ENDIF | |||||||
else | |||||||
set flag to not add this " character to the parameter | |||||||
endif | |||||||
Endif | |||||||
ENDIF | |||||||
ENDIF | |||||||
Add backslashes to output | |||||||
m = m/2 (floor divide e.g. 0/2=0, 1/2=0, 2/2=1, 3/2=1, 4/2=2, 5/2=2, etc.) | |||||||
d. | add m backslashes | ||||||
e. | add this character to our parameter | ||||||
ENDLOOP |
|
|
Note: The result is what gets passed as part of the lpCommandLine argument to the CreateProcess() API. The newly created process still needs to retrieve the lpCommandLine string and parse off the parameters using it's own parsing rules (e.g. if it's a C/C++ program, it will use the Microsoft C/C++ parameter parsing rules to create the argv[] vector. See Putting It Together below for more on this).
Outside of Double Quotes Escape The Essential Characters < > & | ^ |
---|
>ShowParams.exe !\^"#$%^&'()*+,-./0123456789:;^<=^>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^^_`abcdefghijklmnopqrstuvwxyz{^|}~
└┴┘ ▲↑_ ↑_ ↑_ ↑_ ↑_ lpCommandLine = ShowParams.exe !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
↑_ | These characters have been escaped with ^ |
└┴┘ | The " character has been escaped with ^ so it doesn't start a double quoted part when cmd.exe parses it.
Then ^" is escaped by \ so ShowParams.exe will see it as a literal " (Microsoft C/C++ parsing rules) The result is: \^" → cmd.exe parses to give \" → ShowParams.exe parses to give → " |
▲ | Note if this command line is to be put in a batch file, the % will need to be doubled. |
Outside of Double Quotes It's OK to Escape Everything |
---|
>ShowParams.exe ^!^\^"^#^$^%^&^'^(^)^*^+^,^-^.^/^0^1^2^3^4^5^6^7^8^9^:^;^<^=^>^?^@^A^B^C^D^E^F^G^H^I^J^K^L^M^N^O^P^Q^R →
└┴┴┘ ▲ → ^S^T^U^V^W^X^Y^Z^[^\^]^^^_^`^a^b^c^d^e^f^g^h^i^j^k^l^m^n^o^p^q^r^s^t^u^v^w^x^y^z^{^|^}^~ lpCommandLine = ShowParams.exe !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
→ | line continues |
└┴┴┘ | The " character has been escaped with ^ so it doesn't start a double quoted part when cmd.exe parses it.
Then ^" is escaped by \ so ShowParams.exe will see it as a literal " (Microsoft C/C++ parsing rules) \ itself is escaped by ^ just for the heck of it (it's OK to escape everything). The result is: ^\^" → cmd.exe parses to give \" → ShowParams.exe parses to give → " |
▲ | Note if this command line is to be put in a batch file, the % will need to be doubled. |
Inside Double Quotes Escape Nothing |
---|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
│ │ >ShowParams.exe "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ↑ ▲ lpCommandLine = ShowParams.exe "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" |
" | Outside a double quoted part, when not escaped with a ^, a double quote " produces a double quote " and begins a double quoted part |
" | Inside a double quoted part, a double quote " produces a double quote " and ends the double quoted part |
The " character is always included as part of the parameter | |
↑ | Note the " character has been left out of the sequence as it would end the double quoted part. (You can't escape a " while in a double quoted part. The closest we could get would be to use ^" which would give us a ^" and not end the double quoted part.) |
▲ | Note if this command line is to be put in a batch file, the % will need to be doubled. |
Parameter |
Result |
Comment |
|
---|---|---|---|
PROGRAMFILES |
→ |
PROGRAMFILES |
|
"PROGRAMFILES" |
→ |
"PROGRAMFILES" |
|
%PROGRAMFILES% |
→ |
C:\Program Files |
an environment variable |
"%PROGRAMFILES%" |
→ |
"C:\Program Files" |
" + an environment variable + " |
%XYZ% |
→ |
%XYZ% |
(if XYZ is not an environment variable) |
A command line passed to a C/C++ program passes through two parsers:
Here are some examples:
Parsing Example 1 |
---|
1. ShowParams.exe Bed Bath ^& Beyond └┘ ↓ ↓ 2. ↓ Bed Bath & Beyond ↓ ↓ ↓ 3. ↓ Bed Bath & Beyond ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] ↓ ↓ ↓ argv[2] ↓ ↓ argv[3] ↓ argv[4] param 0 = ShowParams.exe param 1 = Bed param 2 = Bath param 3 = & param 4 = Beyond |
1. | cmd.exe command line parser interprets ^& as an escaped & character so it does not interpret this as “start a new command.” (It's possible to put more than one DOS command on a command line by separating them with the & character.) |
2. | C/C++ command line parser receives this. There are no double quotes for it to process. |
3. | C/C++ command line parser parses off the command line parameters into the argv[] array. |
Parsing Example 2 |
---|
┌─────┐
│ │ 1. ShowParams.exe Bed \"Bath\" ^& Beyond └┘ ↓ ↓ 2. ↓ Bed \"Bath\" & Beyond ↓ └┘ └┘ ↓ ↓ 3. ↓ Bed "Bath" & Beyond ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] ↓ ↓ ↓ argv[2] ↓ ↓ argv[3] ↓ argv[4] param 0 = ShowParams.exe param 1 = Bed param 2 = "Bath" param 3 = & param 4 = Beyond |
1. | cmd.exe command line parser interprets the first " as “Start a double quoted part” and the second " as “End the double quoted part.” cmd.exe does not remove the double quote characters. (Note that these double quotes are not escaped with the ^ character, which is the escape character for cmd.exe. Also note the \ character is treated as an ordinary character by cmd.exe) |
cmd.exe command line parser interprets ^& as an escaped & character so it does not interpret this as “start a new command.” (It's possible to put more than one DOS command on a command line by separating them with the & character.) | |
2. | C/C++ command line parser receives this. The C/C++ parser interprets \" as an escaped double quote so neither one starts a double quoted part. |
3. | C/C++ command line parser parses off the command line parameters into the argv[] array. |
Parsing Example 3 |
---|
1. ShowParams.exe ^"Bed Bath ^& Beyond^" └┘ └┘ └┘ ↓ ↓ ┌─────────────────┐ ↓ │ │ 2. ↓ "Bed Bath & Beyond" ↓ ↓ ↓ ↓ ↓ ↓ 3. ↓ Bed Bath & Beyond ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] param 0 = ShowParams.exe param 1 = Bed Bath & Beyond |
1. | cmd.exe command line parser interprets ^" as an escaped " character so it does not start or end a double quoted part. |
cmd.exe command line parser interprets ^& as an escaped & character so it does not interpret this as “start a new command.” (It's possible to put more than one DOS command on a command line by separating them with the & character.) | |
2. | C/C++ command line parser receives this. The C/C++ parser interprets " as “start or end a double quoted part” and the double quotes are removed. |
3. | C/C++ command line parser parses off the command line parameters into the argv[] array. |
Parsing Example 4 |
---|
1. ShowParams.exe ^"Bed \^"Bath\^" ^& Beyond^" └┘ └┘ └┘ └┘ └┘ ↓ ↓ ┌─────────────────────┐ ↓ │ │ 2. ↓ "Bed \"Bath\" & Beyond" ↓ └┘ └┘ ↓ ↓ ↓ ↓ ↓ ↓ 3. ↓ Bed "Bath" & Beyond ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] param 0 = ShowParams.exe param 1 = Bed "Bath" & Beyond |
1. | cmd.exe command line parser interprets ^" as an escaped " character so it does not interpret this as “Start a double quoted part.” |
cmd.exe command line parser interprets ^& as an escaped & character so it does not interpret this as “Start a new command.” (It's possible to put more than one DOS command on a command line by separating them with the & character.) | |
2. | C/C++ command line parser receives this. The C/C++ parser interprets \" as an escaped double quote so they do not start a double quoted part. |
3. | C/C++ command line parser parses off the command line parameters. |
It gets harder when double quotes are not escaped with ^ as cmd.exe will now interpert them as “Start or end a double quoted part.”
Parsing Example 5 |
---|
┌──────────────────┐
│ │ 1. ShowParams.exe "Bed Bath ^& Beyond" ↓ ↓ ┌──────────────────┐ ↓ │ │ 2. ↓ "Bed Bath ^& Beyond" ↓ ↓ ↓ ↓ ↓ ↓ 3. ↓ Bed Bath ^& Beyond ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] param 0 = ShowParams.exe param 1 = Bed Bath ^& Beyond |
1. | cmd.exe command line parser interprets the first " as “Start a double quoted part” and the second " as “End the double quoted part.” cmd.exe does not remove the double quote characters. |
Inside the double quoted part cmd.exe interprets all characters literally, including ^ and & | |
2. | C/C++ command line parser receives this. The parser interprets the first " as “Start a double quoted part” and the second " as “End the double quoted part.” The double quotes are removed. |
3. | C/C++ command line parser parses off the command line parameters into the argv[] array. |
Parsing Example 6 |
---|
1. ShowParams.exe ^"Bed Bath \^" Beyond^" └┘ └┘ └┘ ↓ ↓ ┌──────────────────┐ ↓ │ │ 2. ↓ "Bed Bath \" Beyond" ↓ ↓ ↓ ↓ ↓ ↓ 3. ↓ Bed Bath " Beyond ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] param 0 = ShowParams.exe param 1 = Bed Bath " Beyond |
1. | cmd.exe command line parser interprets ^" as an escaped " character so it does not start or end a double quoted part. |
cmd.exe command line parser interprets ^& as an escaped & character so it does not interpret this as “start a new command.” (It's possible to put more than one DOS command on a command line by separating them with the & character.) | |
2. | C/C++ command line parser receives this. The parser interprets " as “start or end a double quoted part” and the double quotes are removed. |
3. | C/C++ command line parser parses off the command line parameters into the argv[] array. |
Parsing Example 7 |
---|
1. ShowParams.exe ^"Bed Bath \\\^" Beyond^" └┘ └┘ └┘ ↓ ↓ ┌────────────────────┐ ↓ │ │ 2. ↓ "Bed Bath \\\" Beyond" └┴┴┘ ↓ ↓ ↓ ↓ ↓ ↓ 3. ↓ Bed Bath \" Beyond ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] param 0 = ShowParams.exe param 1 = Bed Bath \" Beyond |
1. | cmd.exe command line parser interprets ^" as an escaped " character so it does not start or end a double quoted part. The ^ is removed. The " is not removed. |
2. | The C/C++ command line parser receives this.
The C/C++ command line parser interprets the first " as “Start a double quoted part” and the double quote is removed. The C/C++ command line parser interprets \\\" inside the double quoted part as a literal \" The C/C++ command line parser interprets the ending " as “End the double quoted part” and the double quote is removed. |
3. | The C/C++ command line parser fills the argv[] array with the result. |
Parsing Example 8 |
---|
1. ShowParams.exe ^"\^"Bed Bath Beyond\^"^" └┘ └┘ └┘└┘ ↓ ↓ ┌───────────────────┐ ↓ │ │ 2. ↓ "\"Bed Bath Beyond\"" └┘ └┘ ↓ ↓ ↓ ↓ ↓ ↓ 3. ↓ "Bed Bath Beyond" ↓ ↓ ↓ ↓ ↓ ↓ 4. argv[0] argv[1] param 0 = ShowParams.exe param 1 = "Bed Bath Beyond" |
1. | cmd.exe command line parser interprets ^" as an escaped " character so it does not start or end a double quoted part. The ^ is removed. The " is not removed.
cmd.exe command line parser interprets \ as an ordinary character. cmd.exe command line parser interprets ^" as an escaped " character so it does not start or end a double quoted part. The ^ is removed. The " is not removed. cmd.exe command line parser interprets Bed Bath Beyond\ as ordinary characters. cmd.exe command line parser interprets ^" as an escaped " character so it does not start or end a double quoted part. The ^ is removed. The " is not removed. cmd.exe command line parser interprets ^" as an escaped " character so it does not start or end a double quoted part. The ^ is removed. The " is not removed. |
2. | The C/C++ command line parser receives this.
The C/C++ command line parser interprets the first " as “Start a double quoted part” and the double quote is removed. The C/C++ command line parser interprets \" inside the double quoted part as a literal " The C/C++ command line parser interprets \" inside the double quoted part as a literal " The C/C++ command line parser interprets the ending " as “End the double quoted part” and the double quote is removed. |
3. | The C/C++ command line parser fills the argv[] array with the result. |
A Simplified method: (2016) (updated 2019)
The trick is to enclose parameters with ^" instead of just "
e.g. instead of:
use
The command processor cmd.exe will strip off the ^ and won't start any double quoted parts.
Simplified method steps:
• Start with the parameter you want
Example 8.1: Bed Bath & Beyond |
Parameter |
|
---|---|---|
Start with the parameter you want (parameter includes spaces) | Bed Bath & Beyond |
|
1. | Search for any " | no " in parameter |
2. | Escape with ^ all special characters: ^ < > | & ( ) "
i.e. replace ^ with ^^ replace < with ^< replace > with ^> replace | with ^| replace & with ^& replace ( with ^( replace ) with ^) replace " with ^" |
Bed Bath ^& Beyond
|
3. | double the number of trailing \ | no trailing \ |
4. | Add a leading and trailing ^" | ^"Bed Bath ^& Beyond^"
|
5. | If this will be placed in a batch file, double the % characters | no % in parameter |
Result: To get desired parameter use this: |
^"Bed Bath ^& Beyond^" |
|
Now examine how this parameter gets parsed: | ||
A. | cmd.exe treats ^ as escape character.
cmd.exe finds no double quoted parts because all " are escaped with ^ cmd.exe removes escape character ^ |
^"Bed Bath ^& Beyond^"
|
B. | cmd.exe passes this to the C/C++ program | "Bed Bath & Beyond" |
C. | C/C++ program parses string starting at the beginning.
C/C++ program encounters initial " and starts a double quoted part. The " is removed. |
┌──────
|
D. | C/C++ program copies characters to output parameter until it encounters closing "
The double quoted part ends and the " is removed. |
┌─────────────────┐
|
E. | C/C++ program encounters space (or end of string) after parameter.
Since we are no longer in a double quoted part, parser declares this is the end of the parameter. |
┌─────────────────┐
|
F. | Result is the desired parameter we started with | Bed Bath & Beyond |
Example 8.1b: Bed Bath & Beyond\ |
Parameter |
|
---|---|---|
Start with the parameter you want (parameter includes spaces) | Bed Bath & Beyond\ |
|
1. | Search for any " | no " in parameter |
2. | Escape with ^ all special characters: ^ < > | & ( ) "
i.e. replace ^ with ^^ replace < with ^< replace > with ^> replace | with ^| replace & with ^& replace ( with ^( replace ) with ^) replace " with ^" |
Bed Bath ^& Beyond\
|
3. | double the number of trailing \ | Bed Bath ^& Beyond\\
|
4. | Add a leading and trailing ^" | ^"Bed Bath ^& Beyond\\^"
|
5. | If this will be placed in a batch file, double the % characters | no % in parameter |
Result: To get desired parameter use this: |
^"Bed Bath ^& Beyond\\^" |
|
Now examine how this parameter gets parsed: | ||
A. | cmd.exe treats ^ as escape character and removes them.
cmd.exe finds no double quoted parts because all " are escaped with ^ |
^"Bed Bath & Beyond\\^"
|
B. | cmd.exe passes this as parameter to the C/C++ program | "Bed Bath & Beyond\\" |
C. | C/C++ program sees the first double quote as beginning a double quoted part.
This double quote is not added to the parameter. |
┌──────────────
|
D. | C/C++ program copies characters to the output parameter.
When it encounters the \ it finds two \ followed by a " • Two is an even number • We are currently in a double quoted part • The character following the " is not another " → Therefore two/2=1 backslashes are added to the parameter → and the " ends the double quoted part |
┌──────────────────┐
|
E. | Result is the desired parameter we started with | Bed Bath & Beyond\ |
Now examine what would happen if we had only one backshash at the end instead of two: | ||
A. | cmd.exe treats ^ as escape character and removes them.
cmd.exe finds no double quoted parts because all " are escaped with ^ |
^"Bed Bath & Beyond\^"
|
B. | cmd.exe passes this as parameter to the C/C++ program | "Bed Bath & Beyond\" |
C. | C/C++ program sees the first double quote as beginning a double quoted part | ┌──────────────
|
D. | C/C++ program copies characters to the output parameter.
When it encounters the \ it finds one \ followed by a " • One is an odd number → One/2=0 so no backslashes are added to the parameter • We are currently in a double quoted part → Therefore the " is added to the parameter. The double quoted part continues. |
┌────────────────────
|
E. | If there was more following this it would be considered a part of the same parameter.
If the command line abruptly ends, the parameter is accepted as is, even though the double quoted part wasn't closed properly. |
Bed Bath & Beyond" |
Example 8.1c: Bed Bath \\\ Beyond |
Parameter |
|
---|---|---|
Start with the parameter you want (parameter includes spaces) | Bed Bath \\\ Beyond |
|
1. | Search for any " | no " in parameter |
2. | Escape with ^ all special characters: ^ < > | & ( ) "
i.e. replace ^ with ^^ replace < with ^< replace > with ^> replace | with ^| replace & with ^& replace ( with ^( replace ) with ^) replace " with ^" |
no special characters in parameter |
3. | double the number of trailing \ | no trailing \ |
4. | Add a leading and trailing ^" | ^"Bed Bath \\\ Beyond^"
|
5. | If this will be placed in a batch file, double the % characters | no % in parameter |
Result: To get desired parameter use this: |
^"Bed Bath \\\ Beyond^" |
|
Now examine how this parameter gets parsed: | ||
A. | cmd.exe treats ^ as escape character and removes them.
cmd.exe finds no double quoted parts because all " are escaped with ^ |
^"Bed Bath \\\ Beyond^"
|
B. | cmd.exe passes this as parameter to the C/C++ program | "Bed Bath \\\ Beyond" |
C. | C/C++ program sees the first double quote as beginning a double quoted part.
This double quote is not added to the parameter. |
┌────────
|
D. | C/C++ program copies characters to the output parameter.
Parser comes to the \\\ followed by a space → Since \\\ is not followed by a " they are copied as is. |
┌────────────
|
E. | Parser comes to the "
→ We are in a double quoted part, so parser checks to see if there's another " immediately following, which there is not, so this " ends the double quoted part and the " is not added to the parameter. |
┌───────────────────┐
|
E. | Result is the desired parameter we started with | Bed Bath \\\ Beyond |
Example 8.2: Bed "Bath" & Beyond |
Parameter |
|
---|---|---|
Start with the parameter you want (parameter includes spaces) | Bed "Bath" & Beyond |
|
1. | Search for any "
Double the number of \ immediately preceding any " (there are none) Then add one more \ before each " |
Bed \"Bath\" & Beyond
|
2. | Escape with ^ all special characters: ^ < > | & ( ) " | |
i.e. replace ^ with ^^
replace < with ^< replace > with ^> replace | with ^| replace & with ^& replace ( with ^( replace ) with ^) replace " with ^" |
Bed \^"Bath\^" ^& Beyond
|
|
3. | double the number of trailing \ | no trailing \ |
4. | Add a leading and trailing ^" | ^"Bed \^"Bath\^" ^& Beyond^"
|
5. | if this will be placed in a batch file, double the % characters | no % in parameter |
Result: To get desired parameter use this: |
^"Bed \^"Bath\^" ^& Beyond^" |
|
Now examine how this parameter gets parsed: | ||
A. | cmd.exe treats ^ as escape character and removes them.
cmd.exe finds no double quoted parts because all " are escaped with ^ |
^"Bed \^"Bath\^" ^& Beyond^"
|
B. | cmd.exe passes this as parameter to the C/C++ program | "Bed \"Bath\" & Beyond" |
C. | C/C++ program sees this as a double quoted parameter.
Note that all " inside the parameter are escaped with \ |
┌─────────────────────┐
|
D. | C/C++ program applies the rule 2n+1 backslashes followed by a "
produce n backslashes + a literal quotation mark. \" becomes " (for n=0) |
Bed \"Bath\" & Beyond
|
E. | Result is the desired parameter we started with | Bed "Bath" & Beyond |
Example 8.3: Bed Bath & \"Beyond" |
Parameter |
|
---|---|---|
Start with the parameter you want (parameter includes spaces) | Bed Bath & \"Beyond" |
|
1. | Search for any "
Double the number of \ immediately preceding any " Then add one more \ before each " |
Bed Bath & \\\"Beyond\"
|
2. | Escape with ^ all special characters: ^ < > | & ( ) " | |
i.e. replace ^ with ^^
replace < with ^< replace > with ^> replace | with ^| replace & with ^& replace ( with ^( replace ) with ^) replace " with ^" |
Bed Bath ^& \\\^"Beyond\^"
|
|
3. | double the number of trailing \ | no trailing \ |
4. | Add a leading and trailing ^" | ^"Bed Bath ^& \\\^"Beyond\^"^"
|
5. | if this will be placed in a batch file, double the % characters | no % in parameter |
Result: To get desired parameter use this: |
^"Bed Bath ^& \\\^"Beyond\^"^" |
|
Now examine how this parameter gets parsed: | ||
A. | cmd.exe treats ^ as escape character and removes them.
cmd.exe finds no double quoted parts because all " are escaped with ^ |
^"Bed Bath ^& \\\^"Beyond\^"^"
|
B. | cmd.exe passes this as parameter to the C/C++ program | "Bed Bath & \\\"Beyond\"" |
C. | C/C++ program sees this as a double quoted parameter.
Note that all " inside the parameter are escaped with \ |
┌───────────────────────┐
|
D. | C/C++ program applies the rule 2n+1 backslashes followed by a "
produce n backslashes + a literal quotation mark \\\" becomes \" \" becomes " |
Bed Bath & \\\"Beyond\"
|
E. | Result is the desired parameter we started with | Bed Bath & \"Beyond" |
Example 8.4: (Bed) <Bath> & "Beyond" | \"Kohl^s |
Parameter |
|
---|---|---|
Start with the parameter you want (parameter includes spaces) | (Bed) <Bath> & "Beyond" | \"Kohl^s |
|
1. | Search for any "
Double the number of \ immediately preceding any " Then add one more \ before each " |
(Bed) <Bath> & \"Beyond\" | \\\"Kohl^s
|
2. | Escape with ^ all special characters: ^ < > | & ( ) " | |
i.e. replace ^ with ^^
replace < with ^< replace > with ^> replace | with ^| replace & with ^& replace ( with ^( replace ) with ^) replace " with ^" |
^(Bed^) ^<Bath^> ^& \^"Beyond\^" ^| \\\^"Kohl^^s
|
|
3. | double the number of trailing \ | no trailing \ |
4. | Add a leading and trailing ^" | ^"^(Bed^) ^<Bath^> ^& \^"Beyond\^" ^| \\\^"Kohl^^s^"
|
5. | if this will be placed in a batch file, double the % characters | no % in parameter |
Result: To get desired parameter use this: |
^"^(Bed^) ^<Bath^> ^& \^"Beyond\^" ^| \\\^"Kohl^^s^" |
|
Now examine how this parameter gets parsed: | ||
A. | cmd.exe treats ^ as escape character and removes them.
cmd.exe finds no double quoted parts because all " are escaped with ^ |
^"^(Bed^) ^<Bath^> ^& \^"Beyond\^" ^| \\\^"Kohl^^s^"
|
B. | cmd.exe passes this as parameter to the C/C++ program | "(Bed) <Bath> & \"Beyond\" | \\\"Kohl^s" |
C. | C/C++ program sees this as a double quoted parameter.
Note all " inside the double quoted parameter are escaped with \ |
┌──────────────────────────────────────┐
|
D. | C/C++ program applies the rule 2n+1 backslashes followed by a "
produce n backslashes + a literal quotation mark \" becomes " \\\" becomes \" |
(Bed) <Bath> & \"Beyond\" | \\\"Kohl^s
|
E. | Result is the desired parameter we started with | (Bed) <Bath> & "Beyond" | \"Kohl^s |
Example 8.5: &<>^|()@!" |
Parameter |
|
---|---|---|
Start with the parameter you want |
&<>^|()@!" |
|
1. | Search for any "
Double the number of \ immediately preceding any " Then add one more \ before each " |
&<>^|()@!\"
|
2. | Escape with ^ all special characters: ^ < >| & ( ) " | |
i.e. replace ^ with ^^
replace < with ^< replace > with ^> replace | with ^| replace & with ^& replace ( with ^( replace ) with ^) replace " with ^" |
^&^<^>^^^|^(^)^@^!\^"
|
|
3. | double the number of trailing \ | no trailing \ |
4. | Add a leading and trailing ^" | ^"^&^<^>^^^|^(^)^@^!\^"^"
|
5. | if this will be placed in a batch file, double the % characters | no % in parameter |
Result: To get desired parameter use this: |
^"^&^<^>^^^|^(^)^@^!\^"^" |
|
Now examine how this parameter gets parsed: | ||
A. | cmd.exe treats ^ as escape character and removes them.
cmd.exe finds no double quoted parts because all " are escaped with ^ |
^"^&^<^>^^^|^(^)^@^!\^"^"
|
B. | cmd.exe passes this as parameter to the C/C++ program | "&<>^|()@!\"" |
C. | C/C++ program sees this as a double quoted parameter.
Note all " inside the double quoted parameter are escaped with \ |
┌───────────┐
|
D. | C/C++ program applies the rule 2n+1 backslashes followed by a "
produce n backslashes + a literal quotation mark \" becomes " |
&<>^|()@!\"
|
E. | Result is the desired parameter we started with | &<>^|()@!" |
The following older examples show the harder way of figuring out what to use as parameters.
(Note there are multiple ways of achieving the same result.)
Example 8.6a: &<>^|()@ ! |
Parameter |
||||
---|---|---|---|---|---|
Start with the parameter you want |
&<>^|()@ ! |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
nothing to replace |
|||
b. | enclose the whole parameter in double quotes (because there's a space in the parameter) |
┌──────────┐
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌──────────┐
|
|||
b. | escape the special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
Nothing to escape because it's all in a double quoted part |
|||
c. | if this will be placed in a batch file, double the % characters | no % in parameter |
|||
Result: To get desired parameter use this: |
"&<>^|()@ !" |
||||
Example 8.6b: &<>^|()@ ! |
Parameter |
||||
Start with the parameter you want |
&<>^|()@ ! |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
nothing to replace |
|||
b. | enclose spaces in double quotes
(A double quoted part can be anywhere within a parameter) |
&<>^|()@" "!
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌─┐
|
|||
b. | escape the special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
┌─┐
|
|||
c. | if this will be placed in a batch file, double the % characters | no % in parameter |
|||
Result: To get desired parameter use this: |
^&^<^>^^^|^(^)^@" "^! |
Example 8.7: &<>^|@()!"&<>^|@() ! |
Parameter |
||||
---|---|---|---|---|---|
Start with the parameter you want |
&<>^|@()!"&<>^|@()! |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
&<>^|@()!\"&<>^|@()!
|
|||
b. | enclose the whole parameter in double quotes | "&<>^|@()!\"&<>^|@()!"
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌──────────┐ ┌───
|
|||
we have a problem in that the final " is interpreted by cmd.exe as opening a double quoted part. To avoid this, escape that last " ( the escape character for cmd.exe is ^ ) | ┌──────────┐
|
||||
b. | escape the other special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
┌──────────┐
|
|||
c. | if this will be placed in a batch file, double the % characters | no % in parameter |
|||
Result: To get desired parameter use this: |
"&<>^|@()!\"^&^<^>^^^|@()!^" |
||||
Another way to get the same result would be at step 1b don't enclose the parameter in double quotes, then escape all special characters including the double quote so it doesn't start a double quoted part. |
^&^<^>^^^|@()!\^"^&^<^>^^^|@()!
|
Example 8.8a: &<>^|@() !"&<>^|@() ! |
Parameter |
||||
---|---|---|---|---|---|
Start with the parameter you want (parameter includes leading and trailing double quotes, plus a double quote inside, and two spaces) |
"&<>^|@() !"&<>^|@() !" |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
\"&<>^|@() !\"&<>^|@() !\"
|
|||
b. | enclose the whole parameter in double quotes | ┌──────────────────────────┐
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌─┐ ┌───────────┐┌───
|
|||
we have a problem in that the final " is interpreted by cmd.exe as opening a double quoted part. To avoid this, escape that last " ( the escape character for cmd.exe is ^ ) | ┌─┐ ┌───────────┐
|
||||
b. | escape the special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
┌─┐ ┌───────────┐
|
|||
c. | if this will be placed in a batch file, double the % characters | no % in parameter |
|||
Result: To get desired parameter use this: |
"\"^&^<^>^^^|@() !\"&<>^|@() !\"^" |
||||
Another way to get the same result would be at step 2a just escape all special characters including all double quotes so there are no double quoted parts. |
^"\^"^&^<^>^^^|@() !\^"^&^<^>^^^|@() !\^"^"
|
||||
Example 8.8b: &<>^|@() !"&<>^|@() ! |
Parameter |
||||
Start with the parameter you want (same as 3a) |
"&<>^|@() !"&<>^|@() !" |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
\"&<>^|@() !\"&<>^|@() !\"
|
|||
b. | enclose spaces in double quotes
(A double quoted part can be anywhere within a parameter) |
┌─┐ ┌─┐
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌────────┐ ┌──┐ ┌─┐ ┌───
|
|||
once again we have a problem in that the final " is interpreted by cmd.exe as opening a double quoted part. To avoid this, escape that last " ( the escape character for cmd.exe is ^ ) | ┌────────┐ ┌──┐ ┌─┐
|
||||
b. | escape the other special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
┌────────┐ ┌──┐ ┌─┐
|
|||
c. | if this will be placed in a batch file, double the % characters | no % in parameter |
|||
Result: To get desired parameter use this: |
\"&<>^|@()" "!\"^&^<^>^^^|@()" "!\^" |
||||
Another way to get the same result would be at step 2a just escape all special characters including all double quotes so there are no double quoted parts. |
\^"^&^<^>^^^|@()^" ^"!\^"^&^<^>^^^|@()^" ^"!\^"
|
Example 8.9a: "C:\TEST A\" |
Parameter |
||||
---|---|---|---|---|---|
Start with the parameter you want (parameter includes double quotes and a space) |
"C:\TEST A\" |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
\"C:\TEST A\\\"
|
|||
b. | enclose the whole parameter in double quotes (because there's a space in the parameter) |
┌───────────────┐
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌─┐ ┌┐
|
|||
b. | escape the special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
No special characters to escape |
|||
c. | if this will be placed in a batch file, double the % characters | no % in parameter |
|||
Result: To get desired parameter use this: |
"\"C:\TEST A\\\"" |
||||
Another way to get the same result would be at step 2a just escape all special characters including all double quotes so there are no double quoted parts. |
^"\^"C:\TEST A\\\^"^"
|
||||
Example 8.9b: "C:\TEST A\" |
Parameter |
||||
Start with the parameter you want (same as 4a) |
"C:\TEST A\" |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
\"C:\TEST A\\\"
|
|||
b. | enclose spaces in double quotes
(A double quoted part can be anywhere within a parameter) |
\"C:\TEST" "A\\\"
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌───────┐ ┌────┐ \"C:\TEST" "A\\\" |
|||
b. | escape the special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
It's all in double quoted parts. |
|||
c. | if this will be placed in a batch file, double the % characters | no % in parameter |
|||
Result: To get desired parameter use this: |
\"C:\TEST" "A\\\" |
||||
Another way to get the same result would be at step 2a just escape all special characters including all double quotes so there are no double quoted parts. |
\^"C:\TEST^" ^"A\\\^"
|
Example 8.10a: "C:\TEST %&^ A\" |
Parameter |
||||
---|---|---|---|---|---|
Start with the parameter you want |
"C:\TEST %&^ A\" |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
\"C:\TEST %&^ A\\\"
|
|||
b. | enclose the whole parameter in double quotes | ┌───────────────────┐
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌─┐ ┌┐
|
|||
b. | escape the special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
┌─┐ ┌┐
|
|||
c. | if this will be placed in a batch file, double the % characters | ┌─┐ ┌┐
|
|||
Result: To get desired parameter use this: |
"\"C:\TEST ^%%^&^^ A\\\"" |
||||
Another way to get the same result would be at step 2a just escape all special characters including all double quotes so there are no double quoted parts. |
^"\^"C:\TEST %^&^^ A\\\^"^"
|
||||
c. | and if this will be placed in a batch file, double the % characters | ^"\^"C:\TEST %%^&^^ A\\\^"^"
|
|||
Example 8.10b: "C:\TEST %&^ A\" |
Parameter |
||||
Start with the parameter you want (same as 5a) |
"C:\TEST %&^ A\" |
||||
1. | Apply the Microsoft C/C++ parsing rules | ||||
a. |
|
\"C:\TEST %&^ A\\\"
|
|||
b. | enclose spaces in double quotes
(A double quoted part can be anywhere within a parameter) |
┌─┐ ┌─┐
|
|||
2. | Apply the Command Prompt parsing rules (cmd.exe) | ||||
a. | determine what cmd.exe will see as the quoted parts | ┌───────┐ ┌───┐ ┌────┐
|
|||
b. | escape the special characters not in double quoted parts:
( the escape character for cmd.exe is ^ ) |
it's all in double quoted parts | |||
c. | if this will be placed in a batch file, double the % characters | \"C:\TEST" "%%&^" "A\\\"
|
|||
Result: To get desired parameter use this: |
"\"C:\TEST ^%%^&^^ A\\\"" |
||||
Another way to get the same result would be at step 2a just escape all special characters including all double quotes so there are no double quoted parts. |
\^"C:\TEST^" ^"%^&^^^" ^"A\\\^"
|
||||
c. | and if this will be placed in a batch file, double the % characters | \^"C:\TEST^" ^"%%^&^^^" ^"A\\\^"
|
To get a parameter into a batch file you need to work backwards through the two parsings it will go through:
Example 9.1: &<>^|()@! | Parameter | ||
---|---|---|---|
Start with the parameter you want |
&<>^|()@! |
||
1. | Apply the Command Line to Batch File parsing rules | ||
a. | determine what cmd.exe will see as the quoted parts: | it's all unquoted |
|
b. | escape the special characters not in double quoted parts: | ^^^&^^^<^^^>^^^^^^^|()@!
|
|
Result: To get desired parameter use this: |
^^^&^^^<^^^>^^^^^^^|()@! |
Example 9.2: &<>^|()@! |
Parameter |
||
---|---|---|---|
Start with the parameter you want |
┌─────────┐
|
||
1. | Apply the Command Line to Batch File parsing rules | ||
a. | determine what cmd.exe will see as the quoted parts: | it's all in a double quoted part |
|
b. | escape the special characters not in double quoted parts: | Nothing to escape because it's all in a double quoted part |
|
Result: To get desired parameter use this: |
"&<>^|()@!" |
Example 9.3: &<>^|()@!"&<>^|()@! |
Parameter |
||
---|---|---|---|
Start with the parameter you want |
&<>^|()@!"&<>^|()@! |
||
1. | Apply the Command Line to Batch File parsing rules | ||
a. | determine what cmd.exe will see as the quoted parts: | ┌─────────┐ ┌───
|
|
we have a problem in that the final " is interpreted by cmd.exe as opening a double quoted part. To avoid this, escape that last " |
┌─────────┐
|
||
b. | escape the special characters not in double quoted parts: | ┌─────────┐
|
|
Result: To get desired parameter use this: |
"&<>^|()@!"^^^&^^^<^^^>^^^^^^^|()@!^^^" |
||
Though not necessary, it's OK to escape the rest of the characters: |
┌─────────┐
|
||
An easier way to get the same result would be to escape the " within the parameter so it doesn't end the double quoted part. Then nothing else needs to be escaped since it's all in a double quoted part. |
┌────────────────────┐
|
||
Another way to get the same result would be to escape all the special characters including all the " so nothing is in a double quoted part: |
|||
^^^"^^^&^^^<^^^>^^^^^^^|()@!^^^"^^^&^^^<^^^>^^^^^^^|()@!^^^" |
|||
As before, though it's not necessary, it is OK to escape the rest of the characters: |
|||
^^^"^^^&^^^<^^^>^^^^^^^|^^^(^^^)^^^@^^^!^^^"^^^&^^^<^^^>^^^^^^^|^^^(^^^)^^^@^^^!^^^"
|
Example: > C:\WINDOWS\system32\wscript.exe ShowParams.vbs hello goodbye FridayWhen you run ShowParams.vbs you'll notice the window title says, "Window Script Host".
“If you want to get picky, the truth is that you can’t read
command-line arguments using VBScript; that’s because VBScript
doesn’t know anything about command-line arguments. But
that’s all right; after all, VBScript doesn’t have
to know anything about command-line arguments. That’s because
Windows Script Host takes care of all that stuff.
“Any time you supply a command-line argument to a script that runs under
Windows Script Host (that includes JScript scripts as well as VBScript
scripts) those arguments are automatically stored in the Wscript.Arguments
collection.”
|
Algorithm:
Splitting the Command Line to get Parameters |
---|
start with: ShowParams.exe hello goodbye Friday
|
loop parse off next parameter: skip over spaces, tabs clear " flag save starting address of this parameter LOOP process this character: If space or tab if " flag set accept this space or tab as part of the parameter else write a 0 here to terminate this parameter and goto parse off next parameter Else if " toggle " flag, strip " (shift rest of line left 1 char) move to next char ENDLOOP endloop
1. | Larry Osterman's WebLog The Windows command line is just a string...
http://blogs.msdn.com/larryosterman/archive/2007/10/03/the-windows-command-line-is-just-a-string.aspx Thank you to Delan Azabani for the following explanation: Technically, execl(3) and friends do not allow you to specify a command line string [i], but rather a sequence of previously separated arguments via variadic C arguments. execv(3) and friends are similar, except that they use decayed arrays. The complete exec family includes exec{l,le,lp,v,ve,vp}, fexecve(3), and if you’re using glibc, the execvpe(3) extension. The family may be invoked in a way that allows you to specify a command line string — including, for example, together with sh(1): execl("/path/to/bin/sh", "sh", "-c", command_line, (char *) NULL); This is roughly how system(3) is specified by POSIX [ii]. [i] http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html |
2. | ibid. |
3. | or possibly CScript.exe; WScript.exe is the Windows version, CScript.exe is the console version. You'll find them in the System32 directory. |
4. | In some cases cmd.exe may call ShellExecute() which eventually calls CreateProcess(), passing it a command line. |
5. | On Windows 95,98,ME the Command Prompt Window program was COMMAND.COM .
The parsing rules are the same.
(Back then it was also known as the DOS Prompt, or MS-DOS Prompt. Technically COMMAND.COM
is DOS.
Note there are other Command Prompt Window programs such as JPSoft's "Take Command". (http://jpsoft.com)
Note the following CP/M legacy constructs: 1. Command line arguments can be separated by an unquoted semicolon or comma. This affects builtin commands like COPY and batch file parameters. In particular, I can think of no way to pass A;B (without quotes) as a paramater to a batch file. 2. If the command is called by name (no path), the following slash is treated a separator, as in DIR/P. This affects both builtin commands and external commands. Note: If you want to use NT-style slash-separated paths with DOS utilities you have to quote them (as in TYPE "C:/BOOT.INI"). |
6. | It's been documented in the past, such as here:
"Percent Signs Stripped from Batch File Text" http://support.microsoft.com/kb/75634 and it's mentioned in current documentation here (last sentence of the "Copy Examples" section): "dtutil Utility" http://msdn.microsoft.com/en-us/library/ms162820.aspx Note: JPSoft's Take Command command line utility processes % differently. You'll need to quadruple the % char (http://jpsoft.com) |
7. | See footnote 6 |
8. | See footnote 6 |
9. | JScript is Microsoft's own version of JavaScript. |
10. | "Windows Script Host Basics" http://msdn.microsoft.com/en-us/library/ec0wcxh3(VS.85).aspx
"Description of Windows Script Host (WSH)" http://support.microsoft.com/kb/188135 "Hosting Environments and Script Engines" http://msdn.microsoft.com/en-us/library/s4axe076(VS.85).aspx |
11. | See footnote 6 |
12. | http://www.activestate.com/activeperl/ |
13. | http://strawberryperl.com/ |
14. | http://www.python.org/ |
15. | Technically, WinMain in WinMain.c calls Py_main in main.c passing it __argc and __wargv as argc[] and argv[] respectively. |
16. | Thanks to Christopher Yeleighton for these two points. |
17. | YoLinux.com: GNOME desktop basics → GNOME Desktop Launcher |
18. | The KDE Menu Editor Handbook |
19. | Thanks to András Korn for assistance in updating the *nix section (Feb. 2011). |