Tim,
Playing around some more, I actually found a method that [almost] works
recipe.hooks.postbuild.2.pattern=cmd.exe /c "C:\Users\Frank\Documents\Visual Studio 2019\Projects\TeensyFlash\bin\Release\netcoreapp3.1\TeensyFlash.exe" "{sketch_path}" "\"{ProjectDir}"" {serial.port.num}
produces
C:\Program Files (x86)\Arduino\java\bin>ECHO Sat 09/25/2021 20:14:24.26 Postbuild Hook 1
Sat 09/25/2021 20:14:24.26 Postbuild Hook 1
C:\Program Files (x86)\Arduino\java\bin>"C:\Users\Frank\Documents\Visual Studio 2019\Projects\TeensyFlash\bin\Release\netcoreapp3.1\TeensyFlash.exe" "C:\Users\Frank\Documents\Arduino\Teensy Flash Demo V1" "\"C:\Users\Frank\Documents\Arduino\Teensy Flash Demo V1\"" 6
Teensy Flash Console
Number of arguments in args = 3
C:\Users\Frank\Documents\Arduino\Teensy Flash Demo V1
"C:\Users\Frank\Documents\Arduino\Teensy Flash Demo V1"
6
So I get the correct number of arguments (3) and the correct string layout. The only thing that mystifies me is that I have to deal with the double quotes around the 2nd argument - no idea why only the second argument requires the additional treatment.
I think I'm close enough though, so no need to bother you; I don't really need two arguments that are both paths with spaces - I can get what I need from just {ProjectDir}, as it is essentially identical to {sketch_path}
Frank
The