#include <stdio.h>
int main(int argc, char* argv[])
{
printf("%s\n",argv[1]);
return 0;
}
Use the source code above, then set the command line parameters as shown below
(https://i.loli.net/2020/05/31/GwhgHolvrxt9ipj.png)
Do you really need the hex file in both folder? Or is it enough in one?
If really both are needed, then you have to copy the files. You can do this with two ways:
1) Squirrel scripting
2) Operating system native copy function
Both have to go in the post build step
Project->Build options->Pre/post build steps->Post build
Then you can
1)
[[IO.CopyFile(_("$(TARGET_OUTPUT_FILE)"), _("C:\hexprog"), true );]]
2)
cmd /c xcopy /D /Y PATH\TO\OUTPUT\FILE PATH/TO/NEW/FILE
If you do not need have the hex file in both:
Project->Properties->Build targets->select both targets from the left side->Output file
If you want to use codeblocks to start your programmer and feed the output file directly to the programmer you can use the tools+ plugin to start it directly from codeblocks and feed the outptu file directly