views:

146

answers:

5

Hi all, 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
+1  A: 

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.

John Weldon
+1  A: 

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.

Jeffrey Kemp
A: 

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.

Joey
Yes,i m really looking out for some Automation of the Build process.So just planning to Automate all the manual things we do.So couldnt figure ou a way by which we open a .exe and then load the config file(.cfg) from that window pop up.
Maddy
A: 

Thanks a lot for ur answers.Now if i want to open my textpad through a .bat file,i write my .bat file as shown below

C:\Program Files\TextPad 4\TextPad.exe Now my doubt is what should be added so that i can navigate to a particular file and open it in this textpad.

Thanks and regards Maddy

Maddy
This should have been a comment or an edit to your question ...
Joey
A: 

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.

Jeffrey Kemp