|
Answer» Hi,
I am new to creating batch file. Infact this is my first batch file. I want the user to input values according to question. Below is an example: @echo off echo Hello Welcome to Automation! pause echo Enter the Month, START date, end date, year. set /p month=Enter month? set /p startdate=Enter start date? set /p enddate=Enter end date? set /p year=Enter year? pause echo Enter the date range(start date and end date) in mm/dd/yyyy format. set /p startdaterange=Enter start date range? set /p enddaterange=Enter end date range? pause echo The data for the specified date range has been collected and save echo in you database.
echo Thank you.
Now my question is when user enters month, it should be a valid entry, same for date and year. how will i verify. if user enter ABC for year..the system should promt " invalid data" and should ask th euser to renter the value.
Please help. Thank you. AnuThis can get compacted in batch. You would need to check each response from the user to every possible answer that might be given.
example: for the month you would need to check that 1 the value is not blank 2 there are no characters or other letters 3 the value is not less than one 4 the value is not GREATER than 12 ext.
there are other programming languages that are better suited for this task. Will this solution need to be strictly batch or can say VB or .NET be used? Quote there are other programming languages that are better suited for this task. Will this solution need to be strictly batch or can say VB or .NET be used? I agree with wbrost . But it could be done in batch as an exercise in learning more about batch. Is that what you want? As for me, it would take me about 10 to 20 minutes in a language I know well. But in batch it would be an all day project.It can be done with a for loop. I saw something when reading for /? but I can't remember the switch (if there is any). Hi everyone...
I am new to this forum. Plz guide me how can i post the question.
Thanx
|