Calling Windows commands without dosbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cambridge10
    New Member
    • Aug 2008
    • 1

    Calling Windows commands without dosbox

    Hi,

    I'm using perl Tk and I have to call a couple of Windows commands but they are executed in a dosbox.

    I want to prevent a dosbox is opened or at least hidden for the user. Is there any way to prevent that?

    A dosbox is opened :
    system ("test.txt|p erl prep|afbreek.ex e|klank.exe|per l kleur >output.pho") ;
    system ("mbrola nl3 output.pho output.wav");
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    Have a look at use Win32::Process.

    Here is a sample I found after a quick search.

    Code:
    #!/usr/bin/perl -w
    
    use strict;
    use Win32;
    use Win32::Process;
    
    # Create the process object.
    
    Win32::Process::Create($Win32::Process::Create::ProcessObj,
         "C:\\perl\\bin\\Perl.exe",              # Where Perl is located.
         "perl c:\\yourdir\\yourTKscript.pl",    #
         0,                                      # Don't Inherit
         DETACHED_PROCESS,                       #
         ".") or                                 # current directory
         die print_error();			     # 
         sub print_error(){			     #
             return Win32::FormatMessage(Win32::GetLastError() );
             }
    
    $Win32::Process::Create::ProcessObj -> Resume();
    --Kevin

    Comment

    Working...