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.
Choose a Directory Using Batch File
Name: orangutang Date: October 8, 2006 at 19:47:13 Pacific OS: Windows XP SP2 CPU/Ram: 1024 MB/3.4 GHZ Product: DELL
Comment:
How do I create a batch file that uses the DIR command to list all of the directories in a certain folder and then allow the user to choose which one to pick? Or is it at least possible to strip the folder from the full path and then allow the user to manually input which one to choose? I have a folder which contains folders with their names as the dates and times they were created. Thanks
Name: IVO Date: October 9, 2006 at 07:26:21 Pacific
Reply:
As the batch script is quite complex I prefer to send it by mail, so check your inbox.
0
Response Number 2
Name: Mechanix2Go Date: October 9, 2006 at 07:26:40 Pacific
Reply:
@echo off > %TEMP%\DLIST setLocal EnableDelayedExpansion
set #=0 for /f "tokens=*" %%D in ('dir/s/b/ad \temp\-') do ( set /a #+=1 echo [!#!] %%D >> %TEMP%\DLIST ) type %TEMP%\DLIST set /p dirNUM=choose a directory:_ find "[!dirNUM!]" < %TEMP%\DLIST > %TEMP%\## for /f "tokens=2" %%T in (%TEMP%\##) do ( echo chosen directory is %%T )
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 3
Name: IVO Date: October 9, 2006 at 07:50:36 Pacific
Reply:
Sorry orangutang, but your mail delivery account in yahoo is reported to be invalid...
So post again with a correct mail address or contact me if you want to get the script.
Summary: I need a batch file that takes input that has the full path of the file and removes the directory information. To make it easy, the directory information is ALWAYS the same. Then I want to send the ...
Summary: Hi, I have several batch files that I need to create for school that I am having problems with I was wondering if anyone would be able to help. 4. Create and save in the root of your floppy a batch fi...
Summary: I am trying to create a Command Prompt Batch file that allows you to get a directory listing for typing in the drive letter after the batch file name at the prompt. E.g. choose.bat a: would give you t...