Skip to main content

cmd_line

Function cmd_line 

Source
pub fn cmd_line(exe: &Path, args: &[String]) -> String
Expand description

The single command line cmd.exe /c receives for a .cmd controller. cmd /c strips the first and the last quote of a line that holds more than two, so a quoted executable followed by any quoted argument breaks (MEASURED, Task 25: 'C:\Users\x' is not recognized, and a quoted a&echo INJECTED ran), hence the ONE outer pair. The executable is always quoted, an argument only when it is empty or has whitespace, and a backslash run at the end of a quoted argument is doubled so it cannot escape the closing quote. The launcher already refuses " % & | < > ^ and newlines in controller arguments.