Computing.Net > Forums > Programming > Batch file - multiple prompts

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file - multiple prompts

Reply to Message Icon

Name: grepgirls
Date: August 7, 2008 at 07:37:56 Pacific
OS: Windows XP
CPU/Ram: 1mil GHz
Product: Nogunna Matter X2
Comment:

I need to create a batch file that prompts for several things before proceeding. In order:

1) Ask for target directory (to run .exe against)
2) Which executable to run against target dir(ee-objdump, PRVer, ee-nm, or ALL)
3) Any -flags to use against executable
4) Name of output file (text file to create)
5) Which directory to place text file


Currently, the following is used:

for /R %f IN ("*.*") DO file_report %f >> c:\outputfile.txt

... First, we must currently open cmd prompt, chdir or type directory root (usually DVD-Rom drive, so d:\), then manually edit the last part (the output file name and directory) each time.

file_report is a batch file located in c:\windows , which contains:

echo filename: %1
prver %1
ee-objdump -t %1

This creates a very ugly output file that is hard to read. PRVer and ee-objdump are executables placed in c:\windows and file_report is a batch file also in c:\windows

I want something that prompts for the target path to run those executables against, which excecutable to run (PRVer, ee-objdump, or ee-nm, or ALL), what to name the output file (a .txt file with the contents of the previous), which -flags to use against the executable, and where to place the text file.

You may assume:

- the .exe files are in c:\windows
- the -flags are known by the user
- the user wants output placed in a file that only contains the output or result from the .exe, and does not want an echo of everything the .exe is doing. Only the results.

THANK YOU IN ADVANCE!



Sponsored Link
Ads by Google

Response Number 1
Name: Hans Henrik
Date: August 7, 2008 at 10:30:39 Pacific
Reply:

sorry but im feeling abit dizzy IRL now, wont try to make some complicated solution for you (hopefully som1 else will)
but you should check out these commands..
@echo off
set /P UserQuestion=
~


0

Response Number 2
Name: grepgirls
Date: August 11, 2008 at 12:09:35 Pacific
Reply:

Thanks for the starter stuff - I'm aware of the prompting and how to perform that but I'm looking for more information about contextual input from the user at those prompts - how to give them answers to choose from, what to do when one of those answers is typed in, etc.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


making batchfile 4 yester... javascript OR html help?



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file - multiple prompts

Hiding user input in a Batch File www.computing.net/answers/programming/hiding-user-input-in-a-batch-file/15928.html

Simple Batch file www.computing.net/answers/programming/simple-batch-file/10948.html

Prompt for Variable in Batch File www.computing.net/answers/programming/prompt-for-variable-in-batch-file/12508.html