Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: running exe files of windows with pearl

by tokpela (Chaplain)
on Aug 13, 2009 at 14:41 UTC ( #788314=note: print w/ replies, xml ) Need Help??


in reply to running exe files of windows with pearl

Yes, you can run them through the system command

use strict; use warnings; my @commands; push(@commands, ['dir', '*.*', '/ad', '>', 'file1.txt']); push(@commands, ['dir', '*.*', '>', 'file2.txt']); push(@commands, ['dir', '*.*', '/b', '>', 'file3.txt']); foreach (@commands) { my $command = $_; system(@$command); if ($? == -1) { print "[Error] Failed to execute: [$!]\n"; } elsif ($? & 127) { printf "[Error] Child died with signal %d, %s coredump\n", ($? + & 127), ($? & 128) ? 'with' : 'without'; } else { printf "Child exited with value %d\n", $? >> 8; } } print "Done\n";

I've created an example script for you to start to work from and you can add your own commands once you have tested this initial script to get it working.

Replies are listed 'Best First'.
Re^2: running exe files of windows with pearl
by perlprint (Initiate) on Aug 14, 2009 at 08:56 UTC
    hey can u be more specific..... the exact command that i wanted to do is dis ...updatemanager -p:A114AB03727147FDB8C2EBAAE3967504 -appId:UAC_2_1 -glfv -c:hfnetchk6b.xml -f:C:\Shavlik\datafiles\hfnetchk6b.xml....in command prompt....can u just tell me how to do it..also i have to wait for the message,after the execution of above.. to be displayed in commandprompt and start one more command like dis...pls help me out

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2016-07-24 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (221 votes). Check out past polls.