Maddy
Maddy

Reputation: 141

Batch file doubts

This is a doubt regarding a test.bat file which opens a particular .exe file which is corresponding to my application.So now i am able to open it successfully.But i get stuck up in the next thing which is it should open the File option present in the .exe window IDE and load a .cfg file and then it should open a 'Generate" and click solutions which will generate the solution files.So i jst want to know how could we implement this using a test.bat file.

I hope i am able to convey my problem well.Please get back to me for any more clarifications.

      Thanks and regards
      Maddy

Upvotes: 1

Views: 981

Answers (4)

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60262

TextPad supports command line parameters, to learn them open Textpad, go to Help -> Help Topics, open "Reference Information" and choose "Command Line Parameters."

copied from there:

eg. TEXTPAD.EXE -ac "Read me.txt"(51,20)

In this example TextPad will start up and open "Read me.txt" at line 51, column 20 and display it in a cascaded window.

Upvotes: 1

Joey
Joey

Reputation: 354356

Sounds like you should rather look how to automate your application, not the command-line. As Jeffrey Kamp already noted, batch files can't do anything you can't already do on the command-line so if your application can't be automated from there you're out of luck. One tool which can send clicks and keystrokes to arbitrary windows is AutoIt which may be better for your needs here.

Upvotes: 0

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60262

Windows batch scripts are just a way of automating what you can do from the command line. You will need to find out if your .exe program supports command line parameters to do the things you want to do - otherwise the only other way is to use some third-party tool to record the keystrokes / mouse clicks and replay them later.

Upvotes: 1

John Weldon
John Weldon

Reputation: 40739

If you mean; how do I pass command line parameters through to the exe:

You can specify %1 to pass the first parameter, %2 for the second, and so on, or you can pass all of the params to the batch file through to the exe by specifying %*

For example: test.bat calls test.exe ...

test.bat:
@echo off
test.exe %*

passess all args

test.bat:
@echo off
test.exe %1 %3

passes batch file params 1 and 3 as parameters 1 and 2 to the .exe

Some more nifty features can be found here.

Upvotes: 2

Related Questions