Writing a program that runs another program

This is a discussion on Writing a program that runs another program within the Tech Board forums, part of the Community Boards category; Hello!
I'm working for a pharmacy, and we're looking to remove lot of old records from our system. I've managed ...

Writing a program that runs another program

Hello!

I'm working for a pharmacy, and we're looking to remove lot of old records from our system. I've managed to make a text file with keys to the data we're getting rid of, and our software will allow us to delete individual records no problem. The problem is time/effort. There are roughly 10,000 old records that need to be deleted, and I'm thinking maybe I can code a script to help it along? I just need something that can pull the numbers out of the text file, type them into a specific, targeted text field and click a few buttons until they're all cleared. I've never done anything like this before so I'm kind of clueless as to what to do. I don't need someone to code for me, just someone to point me in the direction of a tutorial or maybe a clue as to how/if this is possible.

It is possible to do such tricks using system-specific library functions. If you don't understand what that means, you might wish to find a decent keylogging application (which records key strokes and possibly mouse actions, for later playback). It is possible to find both free and commercial applications to do that. The problem is you need to be very selective in choosing a product - it's not just a case of asking for recommendations in a forum, or doing a google search. You need to do a proper risk assessment. Keylogging is a technique often used in malware (particularly trojan horses). For that reason, even reputable keylogging and playback applications have been used as part of malware payloads (hence some security suites complain bitterly if you use them) or, if you obtain the keylogger from a less than reputable source, it may come bundled with malware.

I suggest it would be better to get in touch with the developer of the application you are trying to execute. Get them to provide some facility to do the type of batch processing you need (a modified version of the application with a scripting interface, or a separate application). That might or might not come cheap, but it is safer for the business (i.e. less chances of corrupting your operating system and less chances of messing up the records).

If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Well providing the names / vendors of the program(s) you're using at the moment would be a start.
If the (GUI) program you're using interfaces to some well-known database backend (eg. MySQL), then writing code to modify the database directly is definitely doable.

You might even ask the vendor of your database program whether there are any build-in scripting facilities or maybe even an API you can write programs with to access the database.

I realize that you need to read information from a file to "type" on the keyboard. You might find a macro recorder that produces a human-readable macro file. In that case you could write a program to read your data file and create the macro file in that "language".

As far as writing the macro program from scratch in C (and assuming you're on Windows), you could look into commands like the SendInput function .