Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Func _SelfDelete($iDelay = 0)
- Local $sCmdFile
- FileDelete(@TempDir & "scratch.bat")
- $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _
- & ':loop' & @CRLF _
- & 'del "' & @ScriptFullPath & '" > nul' & @CRLF _
- & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _
- & 'del ' & @TempDir & 'scratch.bat'
- FileWrite(@TempDir & "scratch.bat", $sCmdFile)
- Run(@TempDir & "scratch.bat", @TempDir, @SW_HIDE)
- EndFunc
Add Comment
Please, Sign In to add comment