Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: How to execute dos commands from Perl

by Poornima (Initiate)
on May 31, 2012 at 06:57 UTC ( #973442=note: print w/ replies, xml ) Need Help??


in reply to Re: How to execute dos commands from Perl
in thread How to execute dos commands from Perl

Hi, I am trying to execute a .NET exe from Perl script which should execute on dos prompt adn return the control back to perl script. The .NET exe would be sending fax to the users adn create a .done file, which would be read from the perl script after the execution.


Comment on Re^2: How to execute dos commands from Perl
Re^3: How to execute dos commands from Perl
by cdarke (Prior) on May 31, 2012 at 12:55 UTC
    Then how come you say it was executed in a UNIX shell? Are you using Cygwin? Are you trying to execute a .Net program on UNIX?

    Just to be clear, by "dos prompt" and "dos commands" do you mean the Windows cmd.exe shell?
Re^3: How to execute dos commands from Perl
by Anonymous Monk on May 31, 2012 at 18:56 UTC

    IMHO, if you want to execute a .net program on windows, you should use someting like this:

    my $CmdNgen = "$fw20cmd\\ngen.exe"; my $ParmNgenPause = "ngen queue pause"; my $rc; $rc = ProcessItWin( $CmdNgen, $ParmNgenPause ); sub ProcessItWin { my ( $ProcessCmd, $ProcessParam ) = @_; my $ProcessObj = undef; #print "Start $ProcessCmd $ProcessParam\n"; my $rc = Win32::Process::Create( $ProcessObj, $ProcessCmd, $Pr +ocessParam, 0, NORMAL_PRIORITY_CLASS, q{.} ) or $rc = ErrorReport($ProcessCmd); my $pid = $ProcessObj->GetProcessID(); $ProcessObj->Wait(INFINITE); return $rc; } sub ErrorReport { my $cmd = shift; print "\n *** Error CreateProcess: Command=$cmd, ", Win32::For +matMessage( Win32::GetLastError() ), "\n"; return 0; }

    Also please read perldoc Win32::Process

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-09-22 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (182 votes), past polls