Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: Batch File program to search all physical drives and delete .jpg , .jpeg files

Reply
Thread Tools Display Modes

Re: Batch File program to search all physical drives and delete .jpg , .jpeg files

 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      11-11-2009


"freeuserlogin" <> wrote in message
news:...
>
> 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?


 
Reply With Quote
 
 
 
 
Al Dunbar
Guest
Posts: n/a

 
      11-12-2009

"Pegasus [MVP]" <> wrote in message
news:...
>
> "freeuserlogin" <> wrote in message
> news:...
>>
>> 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.


I thought that this newsgroup was language neutral. There certainly are
non-vbs threads, and, unlike microsoft.public.scripting.vbscript, this one
doesn't have vbscript in its name. ;-)

/Al

<snip>


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cloning laptop sata harddrive vista premium Mark Ryan Windows Vista Hardware 5 04-26-2007 07:44 PM
Giving UAC a second chance or why putting a silk dress on a sow its still a pig Adam Albright Windows Vista Games 1 02-27-2007 11:00 PM
Giving UAC a second chance or why putting a silk dress on a sow its still a pig Adam Albright Windows Vista Administration 0 02-27-2007 07:34 PM
Giving UAC a second chance or why putting a silk dress on a sow its still a pig Adam Albright Windows Vista File Management 0 02-27-2007 07:34 PM
Giving UAC a second chance or why putting a silk dress on a sow its still a pig Adam Albright Windows Vista Installation 0 02-27-2007 07:34 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59