Option Explicit MsgBox "Before the self delete", vbInformation, "Self Deleting Script" 'Delete the script DeleteSelf MsgBox "After the self delete", vbInformation, "Self Deleting Script" Sub DeleteSelf() Dim objFSO 'Create a File System Object Set objFSO = CreateObject("Scripting.FileSystemObject") 'Delete the currently executing script objFSO.DeleteFile WScript.ScriptFullName Set objFSO = Nothing End Sub