Computing.Net > Forums > Windows XP > Choose a Directory Using Batch File

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

Reply to Message Icon

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



Sponsored Link
Ads by Google

Response Number 1
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.

By IVO


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 Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Choose a Directory Using Batch File

Directory removal Batch File www.computing.net/answers/windows-xp/directory-removal-batch-file/130669.html

Several DOS Batch Files, Need help www.computing.net/answers/windows-xp/several-dos-batch-files-need-help/141749.html

Command Parameter Batch File www.computing.net/answers/windows-xp/command-parameter-batch-file/141808.html