Rob van der Woude's Scripting Pages

VBScript Scripting Techniques > Files > Self-Destruct

Self-Destruct

 

WSH (WScript.ScriptFullName)
VBScript Code:
' Author:   Denis St-Pierre
' Function: Make a script delete itself
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
objFSO.DeleteFile WScript.ScriptFullName
WScript.Quit
Requirements:
Windows version: any
Network: any
Client software: N/A
Script Engine: WSH
Summarized: Works in any Windows version, with WSH script engine (WSCRIPT.EXE and CSCRIPT.EXE).
 
[Back to the top of this page]

page last modified: 2016-09-19; loaded in 0.0028 seconds