Created
July 14, 2016 17:01
-
-
Save nerflad/ad96d53e70954d137e958514fb619672 to your computer and use it in GitHub Desktop.
Self Deleting Batch Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Delete self, handy for scripts you need manually | |
:: copy and deploy to lots of machines | |
:: Pretty sure I stole this from SS64. | |
set "batchPath=%~0" | |
echo Set objFSO = CreateObject( "Scripting.FileSystemObject" ) > "%~dp0temp.vbs" | |
echo objFSO.DeleteFile( "!batchPath!" ) >> "%~dp0temp.vbs" | |
echo objFSO.DeleteFile WScript.ScriptFullName >> "%~dp0temp.vbs" | |
echo WScript.Quit >> "%~dp0temp.vbs" | |
"%~dp0temp.vbs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment