1.

Solve : batch pasting information into a dos application?

Answer»

Hi
I was wondering could anyone help me with this am bit of a newbie with batch files. Basically I need a batch file to read in a line of text from a textfile and place it in an exceutible dos application. I understand that the window has to be minimised for this to work.

I need a bat file that will work with an already open application in C:\Program\program.EXE
I have already created a separate bat file to open this.
I need it to do the following commands:
return button
read in string from text file
paste -- maybe using the send keys method i.e. SendKey("!{SP}EP")
return button
return button
return button
read in another string
paste
return button


I know this is a lot to ask but any help that you could give me would be much appreciated as I really need this. Even if anyone could show me as far as the forst paste and return.

Thank you in advance,
StaceyI don't understand exactly...
Your bat file may read/write to a text file, and from there your application should read data; or you can launch your bat from the exe, with the same comment - the bat reads/writes to a text file; after bat EXECUTES, the .exe reads from that file.
You can't write to a exe file that executes... (we aren't talking about COMPUTER viruses, isnt'it?). If you have a exe file, why do you want to read a txt file from a bat?
More info please...Hi

Thank you for your response. Just to clarify this is definately NOT a virus. I am WRITING a web based application
and basically this is the end point of the whole thing.

As I have no access to the source code I can only do it this way (I have been given permission to do this)
I have already created a textfile (this is not a bat file). I want the bat file to COPY a line of text for this
and basically paste this into my application. The application I want to paste to is DOS based. It has been written in Delphi 5.

The first few commands that I need it to do (above) are basically the only way that I can see it possibly pasting into the application (I have manually copied a line of text and used the alt space e p keys in order to paste to the application)
However I do not really know how to write a bat file to do this.

If this is not clear please let me know (I'm not very good at explaining things ) and I will
try to clarify again

Thank you very much
Stacey
I suppose you want to replace some text in your .exe file... I have an idea, but that implies programming: you'll have to create a small program that replaces/adds text, after case (that's I would choose if I were you, it's "very simple").
With bat files, you don't have too many options. I really don't know how you would do it in a bat file, except from calling from bat a program (another program) that does what you need. With bat files you are EXECUTING some commands that affect files, folders, system variables, you can't manage the content of the files so easy (I don't know how to do it). A bat "program" use internal commands and external commands. Internal commands are some commands supported by your OS (DOS commands - that's a bad description, I don't know how to explain clearly; these commands don't exist as separate programs, they are supported by operating system's command interpretor, they are a part of it), while external commands are programs (.exe, .cmd, .bat files).Thank you for your response.
The .exe file is a MS-DOS application. This is why i felt I would need a bat file. I dont need it to replace text only put some into a blank field e.g. the first field requires a name.(This will be blank to begin with) If this name is already in the system the application will already bring me to this name only if I press the return button. Is there a way of doing this automatically with your suggestion of writing a separate program?
From what you have said this seems impossible to do.
As with your suggestion of writing a program for the text what language would you
suggest?
I'm not quite sure what language I could use for this.

Thank you,
Stacey



Discussion

No Comment Found