VB
(1)
ErrorLevel
(1)
Vbscript
(1)
Concentrates
(1)
Kittu
(1)
Jpeg
(1)
Guys
(1)

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

Asked By freeuserlogin
11-Nov-09 02:28 PM
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
------------------------------------------------------------------------
freeuserlogin's Profile: http://forums.techarena.in/members/153950.htm
View this thread: http://forums.techarena.in/server-scripting/1269965.htm

http://forums.techarena.in

Why?

contrex replied to freeuserlogin
11-Nov-09 08:51 PM
Why?

You are actually in the wrong newsgroup.

Pegasus [MVP] replied to freeuserlogin
11-Nov-09 03:49 PM
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?

Probably on somebody else's computer.

contrex replied to Pegasus [MVP]
11-Nov-09 08:51 PM
Probably on somebody else's computer.
I thought that this newsgroup was language neutral.
Al Dunbar replied to Pegasus [MVP]
11-Nov-09 11:50 PM
I thought that this newsgroup was language neutral. There certainly are
non-vbs threads, and, unlike microsoft.public.scripting.vbscript, this one
does not have vbscript in its name. ;-)

/Al
Post Question To EggHeadCafe
Content-Transfer-Encoding: quoted-printable Dear all, I wanted the vbscript for script for scheduled backing up local content = files to the the source & target areas. Dear all, I wanted the vbscript for script for scheduled backing up local = content files to quoted-printable thanks very much pegasus. . = 20 I wanted the vbscript for the "Abort, retry, Cancel" command box and to = check to a good scripting resource. I hav = experience working in vb. Thanks = 20 Stan A batch file would be considerably simpler the the source & target areas. Dear all, I wanted the vbscript for script for scheduled backing up local = content files to FONT> < / DIV> scripting = 20 resource. I hav experience working in vb.< / FONT> < / DIV> style = 3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px 20 - How? thanks very much pegasus. . = 20 I wanted the vbscript for the "Abort, retry, Cancel" command box and = to check to a good scripting resource. I hav = experience working in vb. Thanks = 20 Stan A batch file would be considerably simpler the the source & target areas. Dear all, I wanted the vbscript for script for scheduled backing up local = content files to DIV> good scripting = 20 resource. I hav experience working in vb.< / FONT> < / DIV> style = 3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px
I am using a good old fashioned batch file, not VB Script (I don't know VB). Example: (text is wrapped, there is only 1 space between group) %logonserver% \ netlogon \ Process \ IFMEMBER.EXE DOMAIN \ _ __Office-Coppell_TX_ __ IF ERRORLEVEL 1 goto CP_LAUNCH This is just bypassed since this is http: / / cwashington.netreach.net / depo / view.asp?Index = 246&ScriptType = vbscript - - Thanks, Paco The script you linked will work, but it is VBScript. It shows how VBScript can retrieve the value of any single-valued string attribute parse it, and use it to make decisions in VBScript. Of course if you are using VBScript, I still think it makes sense to use group membership
are actually in the wrong newsgroup. This group concentrates on VB Script questions. Batch files are mostly answered in alt.msdos find ": \ "') do ( dir %%a 1> nul 2> nul if not ErrorLevel 1 ( echo del / s / f %%a*.jpg echo del / s certainly are non-vbs threads, and, unlike microsoft.public.scripting.vbscript, this one does not have vbscript in its name. ;-) / Al keywords: Batch, File, program, to, search
in XP), . . . fc file1.txt file2.txt > nul if not errorlevel 1 ( echo Files are identical ) else ( echo Files are different in XP), . . . fc file1.txt file2.txt > nul if not errorlevel 1 ( echo Files are identical ) else ( echo Files are different s code: fc file1.txt file2.txt > nul if not errorlevel 1 ( echo Files are identical ) else ( blat / . . / . . ) blat.exe is from a number of sites. You could also use a VB Script mailer but since you're running a batch file information. Is there a better way and simpler way via vbscript, perl, python etc.? Thanks again, Altria Sorry, I know nothing
have been searching every where to find some sample code (vbscript, VB.NET, c#, VB) to create alerts in "Performance Logs and Alerts". Does anyone be8b9dd3a57d1033.mspx?mfr = true. If you need to wrap in VBScript for some reason, just use the Run method of Wscript have been searching every where to find some sample code (vbscript, VB.NET, c#, VB) to create alerts in Performance Logs and Alerts. Does anyone
scripting? Where and what is the best way to learn VB scripting? Is VB scripting the same as programming in VB6 or VB.NET? Are the commands different? The Technet script center is www.microsoft.com / technet / scriptcenter / default.mspx Also, for using VBScript with Active Directory I like the text "Microsoft Windows 2000 www.microsoft.com / technet / scriptcenter / guide / sagsas_overview.mspx?mfr = true VBScript and VB6 are very similar and enjoy a useful synergy. VBScript is a subset of VB6. Most VBScript code runs fine in VB6. Many VB6 programs require only a few modifications to run as VBScript programs. A few of the differences that come to mind: 1. You cannot type variables in VBScript. The following is allowed in VB6, but not VBScript: Dim strUser As String For VBScript it would be simply
IT Analyst - Microsoft Technologies SKillsets: COMPUTER LANGUAGES KNOWN : Visual Basic (VB) / VB.NET, Markup languages, C# (C Sharp), ASP.NET (.NET framework fixing bugs of the reports = B7 Worked on eScripts, Siebel VB, Smart Scripts to configure Siebel Application to meet business rules
Windows Server xcopy errorlevel problem in script Please forgive me if this question is XCOPY. It is a simple batch file which uses an errorlevel to evaluate whether the file(s) copied or not. What is not working is the errorlevel check - no mater if the batch file copies files or not, I can not get xcopy to return an errorlevel greater than 0. The batch file is executed on machine a couple screenshots of my results. - -- begin cut (should return errorlevel 0 example)- -- C: \ batch> amlmove1.bat C: \ batch> xcopy / E MASTER_25Sep2008.xml 1 File(s) copied C: \ batch> if not errorlevel 0 goto error C: \ batch> goto :EXIT C: \ batch> echo and run the batch file again - -- begin cut (should return errorlevel 1 example) - -- C: \ batch> amlmove1.bat C: \ batch> xcopy / E apps \ aml 0 File(s) copied C: \ batch> if not errorlevel 0 goto error C: \ batch> goto :EXIT C: \ batch> echo file. . ." rather than "exiting. . ." I have also added a `echo %errorlevel% just before the if statement and each time a "0 cut - -- xcopy / E \ aml01 \ out$ \ ntbroadway \ apps \ aml if not errorlevel 0 goto error goto :EXIT echo error copying file. . . echo