Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , , ,

Sponsored Links



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

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 12-11-2009
Member
 
Join Date: Nov 2009
Posts: 1
Batch File program to search all physical drives and delete .jpg , .jpeg files

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

Last edited by freeuserlogin : 12-11-2009 at 01:05 AM.
Reply With Quote
  #2  
Old 12-11-2009
contrex
 
Posts: n/a
Re: Batch File program to search all physical drives and delete .jpg, .jpeg files

Why?
Reply With Quote
  #3  
Old 12-11-2009
Pegasus [MVP]
 
Posts: n/a
Re: Batch File program to search all physical drives and delete .jpg , .jpeg files


"freeuserlogin" <freeuserlogin.41i6vb@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?


Reply With Quote
  #4  
Old 12-11-2009
contrex
 
Posts: n/a
Re: Batch File program to search all physical drives and delete .jpg, .jpeg files

On 11 Nov, 20:49, "Pegasus [MVP]" <n...@microsoft.com> wrote:

> Are you sure that you want to go ahead with your plan?


Probably on somebody else's computer.
Reply With Quote
  #5  
Old 12-11-2009
Al Dunbar
 
Posts: n/a
Re: Batch File program to search all physical drives and delete .jpg , .jpeg files


"Pegasus [MVP]" <news@microsoft.com> wrote in message
news:eHzz2BxYKHA.1652@TK2MSFTNGP05.phx.gbl...
>
> "freeuserlogin" <freeuserlogin.41i6vb@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.


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

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Batch File program to search all physical drives and delete .jpg , .jpeg files"
Thread Thread Starter Forum Replies Last Post
Need batch file to delete user files in Windows XP mcamp32 Windows XP Support 1 26-05-2011 11:54 PM
Learning Batch file to open a program or a file Ikshana Windows Software 3 04-04-2011 08:24 PM
Cannot delete a jpeg file Carlton Operating Systems 4 24-04-2010 06:26 AM
Batch file to delete files dynamically freelancer24 Windows Server Help 3 08-02-2009 02:33 AM
Creating a batch file to find and delete certain files Larry TroubleShoot 98 5 16-11-2008 12:05 AM


All times are GMT +5.5. The time now is 11:32 PM.