How to execute a program using a script lazarus / 11-Options ---------------------------------------------------------------------- Roland57 · 2022-02-04 11:06 Hello! I use Lazarus under Windows on a USB key. I have several projects using Cairo. The Cairo binaries are somewhere on my USB key. I don't want to paste them in each directory. So I wrote this batch file, that I call for example run.cmd: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i @echo off set CAIROBIN=%~d0\applications\compilateurs\newpascal\lazarus\set PATH=%PATH%;%CAIROBIN% %1 So I can open a command prompt and type run my-cairo-program.exe. How can I use my script from the IDE? I see that it is possible, in project options, to execute a command, but I don't see how I can get the name of the executable (the parameter for my batch script). ---------------------------------------------------------------------- trev · 2022-02-04 21:37 See Compiler Commands. I'd try putting your batch file in the Execute AFTER Compile + Build and uncheck Run (untested). ---------------------------------------------------------------------- engkin · 2022-02-04 23:54 Or you can use External Tools, which gives you more control over the process. Like show/hide console window, add shortcut,..etc. Either way you need $TargetFile() or $OutputFile() as a parameter ---------------------------------------------------------------------- Roland57 · 2022-02-05 02:33 @trev, engkin Thanks. ---------------------------------------------------------------------- Roland57 · 2022-02-21 11:51 I could finally test your suggestions. (I didn't have a Windows system under the hand last two weeks.) Quote from: trev on February 04, 2022, 10:37:48 pmI'd try putting your batch file in the Execute AFTER Compile + Build and uncheck Run (untested). Yes, it works (image 1). Quote from: engkin on February 05, 2022, 12:54:24 amOr you can use External Tools, which gives you more control over the process. Like show/hide console window, add shortcut,..etc. Either way you need $TargetFile() or $OutputFile() as a parameter It works too (image 2). Thanks again.