123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
Find And Delete

--------------------------------------------------------------------------------

Description : This searches through each file in a folder with .htm, .html, and .asp extensions and searches for a string. If the string is found it is replaces with a blank or can be modified to replace with another string.

****** FindAndDelete.vbs ************

Const ForReading = 1
Const ForWriting = 2

Set fso = Wscript.CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder("d:inetpubwwwroot")
Set files = folder.files

varText = "Script that you want to delete"

For Each f1 In files
If InStr(f1,".asp") > 0 Or InStr(f1,".htm") > 0 Or InStr(f1,".html") > 0
Then
Set f = fso.OpenTextFile(f1,ForReading)
If Not f.AtEndOfStream Then
varNew = Replace(f.ReadAll,varText,"")
Set f = fso.OpenTextFile(f1,ForWriting )
f.Write varNew
End If
Set f = Nothing
End If
Next

MsgBox "Change OK"

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG