Computing.Net > Forums > Programming > batch list files of dir+user choice

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 list files of dir+user choice

Reply to Message Icon

Name: datec
Date: July 15, 2008 at 16:20:17 Pacific
OS: 2k/xp
CPU/Ram: 512
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: July 15, 2008 at 19:03:53 Pacific
Reply:

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?


0

Response Number 2
Name: justcallmegreg
Date: July 16, 2008 at 14:08:12 Pacific
Reply:

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
pause

GOTO :Choices

:choice1
echo You chose 1
pause
exit

:choice2
echo You chose 2
pause
exit

Also google batch file tutorials, there's a lot of info out there.

Good luck,

Greg


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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 list files of dir+user choice

I need to copy a file to each users www.computing.net/answers/programming/i-need-to-copy-a-file-to-each-users/15923.html

Batch - list files only (no path) www.computing.net/answers/programming/batch-list-files-only-no-path/17113.html

Batch: copy unlimited # of tokens www.computing.net/answers/programming/batch-copy-unlimited-of-tokens/16852.html