Windows Server - 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
VB
(1)
ErrorLevel
(1)
Vbscript
(1)
Concentrates
(1)
Kittu
(1)
Jpeg
(1)
Guys
(1)
  contrex replied to freeuserlogin
11-Nov-09 08:51 PM
Why?
  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?
  contrex replied to Pegasus [MVP]
11-Nov-09 08:51 PM
Probably on somebody else's computer.
  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
Create New Account
help
I was hoping to use? 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 IFMEMBER.EXE and Domain \ group logonserver% \ netlogon \ Process \ IFMEMBER.EXE DOMAIN \ _ __Office-Coppell_TX_ __ IF ERRORLEVEL 1 goto CP_LAUNCH This is just bypassed since this is a DL, I have tested that populated in AD. - - Thanks, Paco Windows Server Scripting Discussions Active Directory (1) Office (1) VB (1) ObjNetwork.MapNetworkDrive (1) ObjSysInfo.UserName (1) Wscript.Network (1) PhysicalDeliveryOfficeName (1) ObjGroup.IsMember (1 me your opinion on it? 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
permissions have changed Any help would be greatly appreciated! Thanks, Altria Windows Server Scripting Discussions VB (1) XP (1) Report (1) WinScript (1) Vbscript (1) B8ef45694b7d (1) Sysinternals (1) Accessenum (1) er e Try something like this to get file compare) utility. For example (in XP), . . . fc file1.txt file2.txt > nul if not errorlevel 1 ( echo Files are identical ) else ( echo Files are different ) Tom Lavedas * ** ** ** ** ** http: / / there.is file compare) utility. For example (in XP), . . . fc file1.txt file2.txt > nul if not errorlevel 1 ( echo Files are identical ) else ( echo Files are different ) Tom Lavedas * ** ** ** ** ** http: / / there.is more / tglbatch / Building on Tom's code: fc file1.txt file2.txt > nul if not errorlevel 1 ( echo Files are identical ) else ( blat / . . / . . ) blat.exe is a Command Line mailer that you can download from a number of sites. You could also use a VB Script mailer but since you're running a batch file there seems to be little of capturing and automating this information. Is there a better way and simpler way via vbscript, perl, python etc.? Thanks again, Altria Sorry, I know nothing about accesschk and what it
Performance Counters Windows Server I 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 have any sample code to get me started? Windows Server Scripting Discussions VB.NET (1) VB (1) JosephIt (1) Windows (1) Sysmon (1) Corey (1 Vbscript (1) Registry (1) The WMI classes for Performance Monitor alerting is pretty slim. To my library / 93e6fc2b-5bf5-413b-84b4-be8b9dd3a57d1033.mspx?mfr = true. If you need to wrap in VBScript for some reason, just use the Run method of Wscript.Shell. Hope this helps! - - Joseph for, Performance, Counters description: I 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 have
Learning scripting? Windows Server 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? Windows Server Scripting Discussions VB.NET (1) VB (1) Active Directory (1) VBScript (1) NET (1) StrUser (1) ADSI (1) MVP (1) The Technet script center is a resource for example scripts: http: / / www.microsoft.com / technet / scriptcenter / default.mspx Also, for using VBScript with Active Directory I like the text "Microsoft Windows 2000 Scripting Guide - Automating System Administration also available online at: http: / / 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