Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Eliminate pop up window when script executes

by Anonymous Monk
on Feb 10, 2006 at 18:41 UTC ( [id://529427]=perlquestion: print w/replies, xml ) Need Help??

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

I have a script that runs in the Windows NT Task Scheduler and it shows a DOS window pop up each time it runs throughout the day.
How can I eliminate the DOS window that pops up while the script is running?
I want the script to run without anything appearing on my screen. Is that possible?
  • Comment on Eliminate pop up window when script executes

Replies are listed 'Best First'.
Re: Eliminate pop up window when script executes
by sweetblood (Prior) on Feb 10, 2006 at 18:54 UTC
    use wperl.exe instead of perl.exe

    HTH

    Sweetblood

Re: Eliminate pop up window when script executes
by mikeock (Hermit) on Feb 10, 2006 at 19:27 UTC
    BEGIN{require Win32::Console;Win32::Console::Free() if ($^O eq "MSWin32");}
      Thanks,
      Its actually Windows 2000. Do I need to modify anything for it to work with Windows 2000?
        According to the cookbook no. I have used this on WinXP and Win 2000 with no problems. I added this to a script so I could use as scheduled task. Works great and I have not seen any popups when it runs! Hope this helps!
Re: Eliminate pop up window when script executes
by johnnywang (Priest) on Feb 11, 2006 at 02:08 UTC
    It seems sweetblood's answer did not get noticed, "wperl" is what you need, it's in the standard ActiveState distribution, in the bin directory.
Re: Eliminate pop up window when script executes
by vladb (Vicar) on Feb 10, 2006 at 18:45 UTC
    There's a way to use windows scheduler to execute your scripts similar to how one would do it via CRON on a UNIX system.

    There's more info at ActiveState aspn site

    Example from the site:
    at 23:37 /interactive /every:M,T,W,Th,F,S,Su cmd /c "c:\perl\bin\perl.exe c:\test.pl"
    


    _____________________
    "We've all heard that a million monkeys banging on a million typewriters will eventually reproduce
    the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true."

    Robert Wilensky, University of California

Re: Eliminate pop up window when script executes
by duff (Parson) on Feb 10, 2006 at 21:21 UTC

    Look at Win32::Job. It has options to spawn a process in a minimized, maximized or hidden (the one you want) window.

      That doesn't help. He would still have to start a perl script to use Win32::Job, which would display a console before he got chance to spawn a process.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-19 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found