• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

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!
0
bryanchellen
Asked:
bryanchellen
  • 3
  • 2
1 Solution
 
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
 
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:
yes could be
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now