KK99
KK99

Reputation: 1989

How do I run a program minimized from Perl on Windows?

I have a Perl script which starts as an ".exe" (along with my main application)

The job of this perlapp is that it queries how long the application has been open (we have floating license and to free up license we close the main application automatically after 120 mins)

During this process the perlapp which runs in the background invokes another application and it's called system

All works as fine except that the called application via system pops up in the foreground. I want to run it as "minimized". Is this possible?

Upvotes: 0

Views: 561

Answers (1)

simbabque
simbabque

Reputation: 54381

What you need is not Perl-specific, but actually part of your Windows operating system. In order to start any program minimized on Windows, use the following command.

 > start /MIN foo.exe

Now to use this from your Perl program via system is simple.

my $exit_status = system('start /MIN second_application.exe');

Note that this does not work if the program was already running.


Source: tech-recipes.com

Upvotes: 2

Related Questions