[SOLVED] How can I run Windows command before compile? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- egsuh · 2024-08-10 08:05 I'd like to run    sc stop fcgi1 before I compile an FCGI project. But defining it in project options as attached image does not work. How can I do this? ---------------------------------------------------------------------- TRon · 2024-08-10 09:25 Is that a proper representation of what you use for input ? I ask because in teh picture I do not see a clear (back)slash rather a striked W. I am not familiar with sc, is it interactive (e.g. does it wait for you to press a key or answer a question) ? For test (linux) I added a printf "hello world\n" and checked the "show all output line" option. At compilation the messages window then outputs "hello world". See also attached pictures. ---------------------------------------------------------------------- Thaddy · 2024-08-10 12:07 The paths look funny with the strikethrough capital W. That does not belong there. ---------------------------------------------------------------------- Rave · 2024-08-10 14:24 Quote from: Thaddy on August 10, 2024, 02:07:14 pmThe paths look funny with the strikethrough capital W. That does not belong there. Might be a regional thing. Paths in Japanese Windows use a Yen symbol AFAIK. It could be similar here. ---------------------------------------------------------------------- Thaddy · 2024-08-10 17:32 Does not make sense: the paths should adhere. ---------------------------------------------------------------------- egsuh · 2024-08-11 04:32 sc.exe is a Windows command, which can start, stop, install, or remove Windows services. The capital W with cancellation line is backslash in Korean. It does not have any problem in paths. I solved the issue by creating batch files.  In the stopfcgi1.bat,          d:\setups\nssm-2.24\win64\nssm.exe stop fcgi1 and in startfcgi1.bat,          d:\setups\nssm-2.24\win64\nssm.exe start fcgi1 It is not important whether to use nssm or sc. I had to set my acount up not to ask whether I'll allow nssm.exe change device (in Windows). Now I can compile FCGI server files without any hassle.