I need to open lnk file with arguments via Python. On the command line it looks like this:
FlashProgrammer -target=arm image.elf -device=xxxx -vdd=3V3 -erase=mass -program - secure
And it works. But how can I do this in Python? I tried something with subprocess, but got an error: OSError: [WinError 193] %1 is not a valid Win32 application. I think it is due of file extension.
Example code:
import subprocess
flash_programmer_path = "FlashProgrammer.lnk"
args = "FlashProgrammer -target=arm image.elf -device=xxxxx -vdd=3V3 -erase=mass -program - secure"
subprocess.run([flash_programmer_path, args])
Instead of subprocess.run I tried to use subprocess.call giving the same arguments as in the console. However, that doesn't work either.