Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

how to execute .exe through perl

by loki (Novice)
on Jan 05, 2010 at 08:17 UTC ( [id://815702]=perlquestion: print w/replies, xml ) Need Help??

loki has asked for the wisdom of the Perl Monks concerning the following question:

I have a .exe file. this .exe it it asks for the path of a CSV and a .C file. and when i press "Run" button it does some modification in C file and CSV file.

My problem is that I need to execute that .exe through Perl and provide the path of the .C file as well as CSV file path automatically. How can I do that? it is a gui .exe through browse command i can browse and give the path of the c file and CSV.I hope it it is clear what am trying to say... and i need to select option B and i want to execute RUN button automatically through perl ..

here is my EXE looks like
__________________________________________________________ | | |_________________________TEST.EXE________________________| | _____________ | | O A | | | | | RUN | | | O B |_____________| | | | | __________________________________ ___________ | | | .c FILE | | BROWSE | | | |_________________________________| |___________| | | __________________________________ ___________ | | | CSV FILE | | BROWSE | | | |_________________________________| |___________| | | | |_________________________________________________________|

Replies are listed 'Best First'.
Re: how to execute .exe through perl
by BrowserUk (Patriarch) on Jan 05, 2010 at 08:40 UTC

    Unless your (clearly stated) GUI application has provision for being driven by command line switches--unfortunately, very few do--then you would need to use Win32::GuiTest to fill in the edit fields and press the buttons.

    If, as seems likely, you are new to doing this, then be warned, it isn't easy to get right. And it's not something anyone can easily do for you or help you with unless they have a copy of gui application in question. You'll need to read and re-read the documentation for that module and expect to go through a considerable amount of trial and error before you get it right.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: how to execute .exe through perl
by Corion (Patriarch) on Jan 05, 2010 at 08:19 UTC

    Just use system and/or backticks if you want to capture the output of the other program.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: how to execute .exe through perl
by erbin (Novice) on Jan 05, 2010 at 10:04 UTC
    I ever did a simple application like that.

    My GUI is made using MFC. Of course, It can generate a interface as you said.

    In MFC, I embeded the perl interpreter inside, then when pushing the button, Perl file will be explained and executed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://815702]
Approved by matze77
Front-paged by matze77
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-24 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found