Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 8th, 2008, 10:15 PM
Newbie
 
Join Date: Aug 2008
Posts: 1
Default 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|perl prep|afbreek.exe|klank.exe|perl kleur >output.pho");
system ("mbrola nl3 output.pho output.wav");
Reply
  #2  
Old August 17th, 2008, 09:45 PM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 837
Default

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
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles