CreateProcess error = 2


at my platform.txt I have:

tools.Quectel_Flash_Tool.erase.pattern="START /D {cmd.path} /W FlashTool.exe"

but after click Tools -> Burn ... I get error...
Cannot run program "START /D C:\Users\Wiz\AppData\Local\Arduino15\packages\WizIO\tools\bc66_tools\1.0 /W FlashTool.exe"
CreateProcess error=2, The system cannot find the file specified

The link to EXE is OK

FlashTool.exe should be started from a specified directory and I use windows command "start /D folder... /W application"

The error is caused by trying to run start. It has nothing to do with FlashTool.exe. The way to do this is via cmd /C:

tools.Quectel_Flash_Tool.erase.pattern=cmd /C START /D "{cmd.path}" /W FlashTool.exe

This will only work on Windows. If you really need to specify OS-specific recipes, you should do it like this:

tools.Quectel_Flash_Tool.erase.pattern=... /C START /D "{cmd.path}" /W FlashTool.exe

where the first recipe would be for non-Windows OS. You can also specify individual recipes for each OS:

I don't understand why you need to use start at all. Is FlashTool.exe in {cmd.path}?

THANKS !!! ... this is ok:

tools.Quectel_Flash_Tool.erase.pattern=cmd "/C START /D {cmd.path} /W FlashTool.exe"

FlashTool.exe looking for INI file from his folder, but started forder point arduino app folder ...

"non-Windows" yep, but I not have FlashTool and console Uploader for other OS

I’m not sure about your quote placement. Usually, we quote paths in order to handle folders that have spaces in them. The Arduino IDE seems to try to do some automated handling of this, which causes more problems than it fixes in my experience.

Anyway, I’m glad it’s working now!

"quote placement"
I think ... java CreateProcess run APP as first argument and other arguments
Process p = new ProcessBuilder("application", "arguments").start();

so it works :slight_smile: