By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

Calling Windows commands without dosbox

P: 1
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|perl prep|afbreek.exe|klank.exe|perl kleur >output.pho");
system ("mbrola nl3 output.pho output.wav");
Aug 8 '08 #1
Share this Question
Share on Google+
1 Reply


eWish
Expert 100+
P: 971
Have a look at use Win32::Process.

Here is a sample I found after a quick search.

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2.  
  3. use strict;
  4. use Win32;
  5. use Win32::Process;
  6.  
  7. # Create the process object.
  8.  
  9. Win32::Process::Create($Win32::Process::Create::ProcessObj,
  10.      "C:\\perl\\bin\\Perl.exe",              # Where Perl is located.
  11.      "perl c:\\yourdir\\yourTKscript.pl",    #
  12.      0,                                      # Don't Inherit
  13.      DETACHED_PROCESS,                       #
  14.      ".") or                                 # current directory
  15.      die print_error();                 # 
  16.      sub print_error(){                 #
  17.          return Win32::FormatMessage(Win32::GetLastError() );
  18.          }
  19.  
  20. $Win32::Process::Create::ProcessObj -> Resume();
--Kevin
Aug 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.