Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hey guys,
after you had such a great solution for the first problem, i have now another ;-)i want the batch to check a specific directory, let's say "c:\files", list all files, that end with *.ppt, and make a choice table. than the user chooses e.g. number 3, and the batch file continues processing with e.g. echo "you have choosen number 3".
anybody an idea how to solve this in a batch?
thx a ton
datec

you have a solution for your first problem, whatever it is. So what is stopping you from starting to code for yourself? Have you been learning batch since your first problem?

Copy and paste this example.
@echo off
:: Change this to any directory, I used windows because it's already on the computer.
cd c:\windows:: I used all exe's here but you can change that to *.ppt or whatever.
dir *.exe
pause:: Change the following anyway you see fit.
GOTO :Choices:Choices
echo 1. Whatever
echo 2. Whatever
echo 3. Whatever
echo.set /p choice=Please choose a number:
IF NOT '%choice%'=='' set choice=%choice:~0,1%
IF '%choice%'=='1' GOTO choice1
IF '%choice%'=='2' GOTO choice2
IF '%choice%'=='3' GOTO choice3
pauseGOTO :Choices
:choice1
echo You chose 1
pause
exit:choice2
echo You chose 2
pause
exitAlso google batch file tutorials, there's a lot of info out there.
Good luck,
Greg

![]() |
![]() |
![]() |

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