VBS Script help

Hi can anyone help me with a VBS script that will delete *.VBS from the same directory that the script is in

So if i run Script.vbs it will delete itself and another VBS script in the same directory!
bryanchellenAsked:
Who is Participating?
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Could just be a cleaning utitlity...

Dim fso, folder, file, fileCollection
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(".")
Set fileCollection = folder.Files
For Each file In fileCollection
    If UCase(Right(file.Name, 4)) = ".VBS" Then
        fso.DeleteFile file.Name, True
    End If
Next
0
 
bruintjeCommented:
Hello bryanchellen,

that sounds like it could be used for malicious purposes, deleting itself after running
do you have a logical reason for this kind of script?

bruintje
0
 
bruintjeCommented:
yes could be
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bryanchellenAuthor Commented:
I think your a bit crazy bruinjte????

0
 
bryanchellenAuthor Commented:
cheers idle man!
0
 
bruintjeCommented:
yes, that could well be my sincere apologies
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.