Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Launch file without console window

by Phinix (Acolyte)
on Dec 23, 2012 at 23:46 UTC ( #1010136=perlquestion: print w/ replies, xml ) Need Help??
Phinix has asked for the wisdom of the Perl Monks concerning the following question:

As the title suggests, I am looking to launch an external file (in this case an HTML file) using the OS default browser, without the perl app launching it waiting and without creating the annoying console window.

I had attempted this: system(1, "$filepath\\file.html") which launches the file without the perl app waiting, however it also creates an annoying DOS/console window until the browser is closed.

Does anyone know how to prevent this window from showing when launching from a compiled .EXE perl script? Some have suggested using Win32::Process however I cannot seem to figure out the syntax for that.

Comment on Launch file without console window
Re: Launch file without console window
by Anonymous Monk on Dec 23, 2012 at 23:49 UTC

    Does anyone know...

    you do, but you knew that already ;)   [hide dos], [hide console] hide dos, hide console

Re: Launch file without console window
by Phinix (Acolyte) on Dec 24, 2012 at 00:40 UTC
    Hehe... well I think you may have misunderstood. I am able to prevent the console showing up when I launch my main EXE by using the -g switch when I compile it with PAR. What I am trying to do, is prevent an additional console window that shows up when running system() commands from within that executable. :)

      Why are you talking to yourself yet again?

        Yeah, I hit reply on the wrong message. Force of habit. /facepalm
Re: Launch file without console window
by BrowserUk (Pope) on Dec 24, 2012 at 01:14 UTC

    Use system 1, q[start your.html];


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      Thanks! I was just about to post that I had managed to find a solution using system(1, "start /B /MIN cmd /c file.html") and was going to ask if anyone knew where these command switches were documented, as I am not certain what /B or /c are doing.
        "start /B /MIN cmd /c file.html" ... anyone knew where these command switches were documented,

        Hm. You should not need any switches -- for a start [sic] /b (no new window) and /min (minimise new window) are contradictory.

        As a Windows user, you should be familiar with /?, it works with most of the windows commands.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        RIP Neil Armstrong

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1010136]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2014-07-13 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (252 votes), past polls