"freeuserlogin" <freeuserlogin.41i
...@DoNotSpam.com> wrote in message
news:freeuserlogin.41i6vb@DoNotSpam.com...
> hi guys i am kittu
> this is my first post
> i am new to batch file programming and need your help
> i need a batch file program when executed
> it has to search all physical drives in my pc and delete files
> of .jpg and .jpeg extension
> i dont want to define the path of the file located at
> so it has to search all the drives and delete files
> Thank you
> freeuserlogin
You are actually in the wrong newsgroup. This group concentrates on VB
Script questions. Batch files are mostly answered in alt.msdos.batch.nt.
Since your question is quite simple, here is a batch file solution:
@echo off
for /F %%a in ('mountvol ^| find ":\"') do (
dir %%a 1>nul 2>nul
if not ErrorLevel 1 (
echo del /s /f %%a*.jpg
echo del /s /f %%a*.jpeg
)
)
To activate the batch file you need to replace these lines
echo del /s /f %%a*.jpg
echo del /s /f %%a*.jpeg
with these:
del /s /f %%a*.jpg
del /s /f %%a*.jpeg
Note that this is quite a powerful command. It will do exactly what you
asked for: Delete each and every .jpg and .jpeg file on all local drives.
Are you sure that you want to go ahead with your plan?