Suppress message from Windows Script Host vbs script

I use this vbs script below to auto delete NT backups. After each delete it displays a message Deleting "v:\path\filename" How to suppress these messages? See pic embedded

'--------------------------------------------
'This script will delete .bkf files that were
'created "MaxAge" days ago.
'30.1.2009 FNL
'--------------------------------------------
Active = true
sSource = "V:\DailyBackup\SystemStates"
iMaxAge = 6 'days

Checked = 0
Deleted = 0

Set oFSO = CreateObject("Scripting.FileSystemObject")
if active then verb = "Deleting """ Else verb = "Old file: """
CheckFolder oFSO.GetFolder(sSource)

WScript.echo
if Active then verb = " file(s) deleted" else verb = " file(s) would be deleted"
wscript.echo Checked & " file(s) checked, " & Deleted & verb

Sub CheckFolder (oFldr)
For Each oFile In oFldr.Files
if ucase(right(oFile.name, 4)) = ".BKF" then
Checked = Checked + 1
If DateDiff("D", oFile.DateLastModified, Now()) > iMaxAge Then
Deleted = Deleted + 1
WScript.Echo verb & oFile.Path & """"
If Active Then oFile.Delete
End If
end if
Next
End Sub vbs message
yohayonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jawa29Commented:
You just need to remove the Wscript.echo's

Jawa29
0
jawa29Commented:
I have bolded the lines to remove below.

'--------------------------------------------
'This script will delete .bkf files that were
'created "MaxAge" days ago.
'30.1.2009 FNL
'--------------------------------------------
Active = true
sSource = "V:\DailyBackup\SystemStates"
iMaxAge = 6 'days

Checked = 0
Deleted = 0

Set oFSO = CreateObject("Scripting.FileSystemObject")
if active then verb = "Deleting """ Else verb = "Old file: """
CheckFolder oFSO.GetFolder(sSource)

WScript.echo
if Active then verb = " file(s) deleted" else verb = " file(s) would be deleted"
wscript.echo Checked & " file(s) checked, " & Deleted & verb

Sub CheckFolder (oFldr)
For Each oFile In oFldr.Files
if ucase(right(oFile.name, 4)) = ".BKF" then
Checked = Checked + 1
If DateDiff("D", oFile.DateLastModified, Now()) > iMaxAge Then
Deleted = Deleted + 1
WScript.Echo verb & oFile.Path & """"
If Active Then oFile.Delete
End If
end if
Next
End Sub

Jawa29
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yohayonAuthor Commented:
Can I just insert rem or #?
0
jawa29Commented:
To comment out a VBS line you use '

Jawa29
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.