This script demonstrates the use of a function that allows a script to delete itself from disk. The function can be called from anywhere within the script and the script will continue to function normally (assuming the script does not further attempt to access itself on disk). Handy for homebrew uninstallation programs that require the removal of all installation files, including the setup file.
MsgBox "Before the self delete", vbInformation, "Self Deleting Script"
'Delete the script
MsgBox "After the self delete", vbInformation, "Self Deleting Script"
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Delete the currently executing script
Set objFSO = Nothing