Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Run exe (with answering promoted questions) in a batch mode

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Batexe

Batexe
  • Member
  • 2 posts
  • Joined 19-January 13
  • OS:none specified
  • Country: Country Flag
Hi All,

Could anyone help me with coding a batch file I want?

I have one exe file. Once I double click it, a black DOS window pops up and ask me "what name the text file has". I have to type in the full name with extension. After pressing enter, one more question followed up in the same black DOS window something like "how many columns in your file? 1. 10 columns; 2. 100 columns: 3. 150 columns. Thereafter, the exe file will ask a few more similar questions.

I want to let the exe process a number of input text files, only the names and data of input files are different, but actually the number of columns and the number of rows etc. are all the same.

So I thought maybe a batch file can run this exe (with answering promoted questions) in a batch mode.

The code in a bat file may look like:

@echo off
:: Let the exe run and process file1
start C:\Batexe\myprogram.exe
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?

:: Let the exe run and process file2
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?
:: Could anyone help with the code to answer following up questions automatically (no need to even display the questions)?

:: Let the exe run and process file3
.
.
.
I have maybe 100 text input files. The above code blocks I may repeat 100 times (feel stupid). Hope I have made myself clear. So could anyone help me? Thanks in advance!!! I have posted my question else where, but I will keep all of you posted.


How to remove advertisement from MSFN

#2
Batexe

Batexe
  • Member
  • 2 posts
  • Joined 19-January 13
  • OS:none specified
  • Country: Country Flag
Hi All,

I learnt that a batch file has

"C:\xxxx.exe" < input.txt
or
type input.txt | "C:\xxxx.exe"



where the input.txt contains something like the following:
1.txt
1
gaussian
y
y

It worked. Super. Cheers.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users