Jump to content

Wscript.Arguments Drag Drop Delete


Recommended Posts

Here is a script that will delete files it can do multiple files at the same time.

How to use

1:\ Drag any file or files on to the VBS script

Note this does not send the file or files to the recyle bin but deletes the files permently.

Save As Drag_Drop_Delete.vbs

Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim DelFile
For Each DelFile in Wscript.Arguments : Fso.DeleteFile(DelFile) : Next

Link To Updated DragDropDelete

Edited by gunsmokingman
Link to comment
Share on other sites


  • 3 months later...

I have updated the script so it now does Files and Folders.

This does not send any thing to the Recyle Bin it deletes.

Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim DelF, GetF
On Error Resume Next
For Each DelF in Wscript.Arguments
Set GetF = Fso.GetFile(DelF) : GetF.Delete()
Next
For Each DelF in Wscript.Arguments
Set GetF = Fso.GetFolder(DelF) : GetF.Delete()
Next

Here is a Rar file of the above code

Edited by gunsmokingman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...