Hey Tim,
Gustavo, I tried your solution but could not get it to work.
Humm, that's rather strange, I would swear that the way windows works it should work. At least what I thought would be the way Windows would look for the extension.
Maybe I'm confused and it's only possible if you use the
cmd.exe.
I guess that the extension guessing does not apply when Lazarus is running it under a
TProcess.
I did some playing around and found a solution. Instead of using a script, I rewrote it in pascal and compiled a version for linux and one for windows. Then in the execute after I put
$MakeExe($(ProjSrcPath)/clean_after)
The MakeExe macro does nothing under linux so that "clean_after" is executed, and under windows it adds .exe to the name so that "clean_after.exe" is executed.
Once I worked this out it seemed so simple
.
Thanks Lazarus devs for this facility
Oddly enough, this was exactly what I was trying to achieve, LOL

!!
Well, almost. I was trying with the
.bat instead of the
.exe.
But HEY, it works, so problem solved

Looks like I need to revisit my knowledge of how, if even it does,
TProcess looks for the extension of an executable file when you don't include it.
Cheers,
Gus