Computing.Net > Forums > Disk Operating System > 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.

batch file

Reply to Message Icon

Name: westwood01
Date: August 11, 2002 at 09:52:11 Pacific
Comment:

I am new to writing batch files and i need a little help with a small problem.

The following batch file says, "EXT.BAT locates files on the current drive
:: with one or more extensions supplied
:: by the user.
:: Syntax is: EXT ext1".

My question is - Where in the code to I put EXT doc (for example)?

@ECHO OFF

:: EXT.BAT is a multiple extension finder
:: for DOS95, MS-DOS Mode, and Command
:: Prompt Only. It ought to work with
:: previous DOS versions like 6.22 as well.

:: EXT.BAT locates files on the current drive
:: with one or more extensions supplied
:: by the user.
:: Syntax is: EXT ext1 [ext2 ext3 ... ]
:: Eg. 'EXT txt wav exe dll' reveals text,
:: wave, executable, and library files
:: on the current drive.

:: -- Gord Braun August 1998

IF "%1"=="*" GOTO HELP

:LOOP
DIR \*.%1 /A /S | FIND /V /I "DIR(S)" | FIND /V /I "VOLUME IN" | FIND /V /I "VOLUME SER" | MORE > slow.txt
SHIFT
IF NOT "%1"=="" GOTO LOOP
GOTO END

:HELP
ECHO.
ECHO You must provide
ECHO one or more extensions
ECHO for EXT.BAT to search for.
ECHO Eg. EXT txt doc dll htm

:END
ECHO.



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: August 11, 2002 at 13:09:39 Pacific
Reply:

You don't need to change the code. You just need to execute the batch file with the parameter DOC, like this:

EXT doc

Type that on the command prompt and hit enter (you must be in the same directory as the batch file).

You're probably trying to execute the file via windows explorer (double-clicking). That's not a good method for this file.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br



0

Response Number 2
Name: westwoood01
Date: August 11, 2002 at 18:05:11 Pacific
Reply:

Thank you.


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 Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: batch file

Help!! Batch File www.computing.net/answers/dos/help-batch-file/13525.html

Batch files - - Mapping network drive www.computing.net/answers/dos/batch-files-mapping-network-drive/3809.html

Pause batch file www.computing.net/answers/dos/pause-batch-file/2810.html