Programming language for including .exe file into another code

417 Views | 8 Replies | Last: 14 yr ago by Tastybrisket10
Tastybrisket10
How long do you want to ignore this user?
I'd like to write a program where I send batches of files to an already created .exe program then I record the output into a new file. I know that's a pretty general description, but I'm looking to just use an already created .exe program in my code. Any suggestions on what language to use and how to go about writing this code?
DAM
How long do you want to ignore this user?
Batch programming. Can you do what youre trying to do just from the command prompt?

dam
Americium
How long do you want to ignore this user?
batch or Perl can make that pretty simple
AlexNguyen
How long do you want to ignore this user?
You can do this in any programming language. I recall doing something similar with Think Pascal way back in the 90s for a college class.

Your choice would depend primarily I think on who will be scripting the small program and what they are comfortable with. If you're the one doing it and you're a newbie programming, I'd suggest looking up code examples from the web of how you might do it in Python or Windows PowerShell. The task you describe would be trivial to do in either environment.
Tastybrisket10
How long do you want to ignore this user?
Well the problem is this program is a commercial .exe program, not a program that I developed. I submit .dat files to the program and I need to use the program software to output information into a text files.

[This message has been edited by drodriguez910 (edited 5/26/2011 4:12p).]
DAM
How long do you want to ignore this user?
Yeah this might not work, can you pass any variables to this program without opening it?

dam
eric76
How long do you want to ignore this user?
I have a program, led, that can do this. Say your program is foobar and is executed with "foobar src.txt", and you want to apply it to all files in the current directory, you could do

dir *.dat /b | led "_#ifoobar #g999#i >> output.txt" | cmd

If you wanted to store the output from processing each .dat file into a .txt file with the same name, for example x.dat -> x.txt, you could do

dir *.dat /b | led "_#C#F.dat#d4#i.txt#g0#ifoobar #P#i > #" | cmd

I wrote the program originally for Windows. The "_#" changes the delimiter to #. On Windows, you can skip that part and use $ as a delimiter. Thus, the last command becomes

dir *.dat /b | led "C$F.dat$d4$i.txt$g0$ifoobar $P$i > $" | cmd

[This message has been edited by eric76 (edited 5/27/2011 6:29a).]
Tastybrisket10
How long do you want to ignore this user?
I can't really pass anything to it without opening the program. I don't have access to any of the source code either. I know it has a .dll file included in it but I'm not sure how to access that either because there's no header file included and no capability to create one in the program.

Wouldn't you need an open source program to be able to do what I'm trying to do? Because I don't think any type of Perl script would be able to help me here...or would it? I would almost think the best thing to do is get a mouse/keyboard macro program at this point.

[This message has been edited by drodriguez910 (edited 5/27/2011 11:19a).]
Another Doug
How long do you want to ignore this user?
Write it in c++, vb, or c# in visual studio. Spawn the app with any parameters it needs, if it needs input from the user use spy (comes with visual studio) to figure out the the type of messages you need to send it. You can hire me for an hour to write it for you or at the very least get you started.
Tastybrisket10
How long do you want to ignore this user?
i've relegated to doing something similar, i can save the output as xps files and then extract the information i need there by converting those as well. thanks for the help!
Refresh
Page 1 of 1
 
×
subscribe Verify your student status
See Subscription Benefits
Trial only available to users who have never subscribed or participated in a previous trial.