[fpc-pascal] Windows console

José Mejuto joshyfun at gmail.com
Mon Sep 5 16:26:20 CEST 2016


El 05/09/2016 a las 15:01, Santiago A. escribió:
> Hello:
>
> I have a little watchdog utility for windows that runs each five
> minutes, like a unix cron ("Tareas programadas" in Spanish, scheduled
> tasks?). It opened a console window for a second and that was very
> annoying. So I used the switch -GW and there is no more flashing console
> bothering. But then I can't show any help or any output for debug from
> the prompt.
>
> I can live with it, in fact, it usually uses a log file, but some times,
> when I'm installing, testing paramters etc, it's more handy to run the
> program from the prompt and see the result immediately or display the
> help instead of having to open logs.
>
> Is there any way to open a console on the fly and send the output to the
> console?

Hello,

I would create a .bat file in temp folder and run a new shell execute of 
that .bat. This .bat simply display some echo lines and finally autokill 
itself.

If your system for security reasons do not allow run bats then you can 
create a .txt file and launch a shell execute cmd with "type 
\path\file.txt" (keeping session open or it will clear the screen). You 
main program can wait 2-5 seconds and delete the .txt file to not 
pollute the temp folder.

Of course this is a "home made" solution :) Another is have a different 
exe just for the help, have a .bat or .txt in your app folder just to 
show the help if it is always the same, ...

-- 




More information about the fpc-pascal mailing list