mark4 has asked for the wisdom of the Perl Monks concerning the following question:

Hello all great and powerful Monks. Using a Windows OS, How can I spawn a new perl program without popping up a new cmd.exe window? Since I will be pipe-ing all output to file(s), there is no need for an annoying black command window. I know I can start it minimized, But I just don't like all those windows down on that task bar.

example code:
if ($^O eq "linux") { $cmd = "perl-prog.pl &> file1.out"; } else { $cmd = "start /MIN perl-prog.pl > file1.out 2> file2.out" } system ($cmd);

Replies are listed 'Best First'.
Re: How do I start perl without having a "cmd.exe" window (wperl)
by tye (Sage) on Mar 23, 2015 at 13:18 UTC

    Launch it with wperl.exe instead of with perl.exe (wperl is just a copy of perl but with one bit in some header changed).

    - tye        

      Thank you. I love it!! wperl.exe. It's good to be here on perlmonks.org I have asked many people this question and no one had a good answer. You guys are great. I hope I can help others seeking perl wisdom as I have wrote many applications using perl.

        You can also add tools that you use repeatedly to right click context menu in windows. Ive done that for a ton of tools in the past.
        Another option is to create a shortcut to your perl script. Edit the target (on the properties menu) of the shortcut to use wperl. Your script becomes the argument of wperl. It may be necessary to specify the full path of the script. I choose to move the shortcuts to my desktop.
        Bill
Re: How do I start perl without having a "cmd.exe" window
by marinersk (Priest) on Mar 23, 2015 at 20:39 UTC

    Or just change /MIN to /B :

    sleep5.pl: #!/usr/bin/perl use strict; sleep 5; exit; nowin.pl: #!/usr/bin/perl use strict; `start /b sleep5.pl`; exit;