Ever tried to kill the current executable? It's not that straightforward, for security reasons, but it can be done with little helpers:include \masm32\include\masm32rt.inc ; pure Masm32
.data?
ThisExe db MAX_PATH dup(?)
.code
start:
mov edi, offset ThisExe
invoke lstrcpy, edi, chr$("KillMe.exe ")
invoke lstrcat, edi, rv(GetCommandLine) ; this returns the path of the current exe
invoke WinExec, edi, SW_MINIMIZE
add edi, 11 ; advance to compensate for <KillMe.exe >
print "check your disk to see if "
print edi
print " was killed"
exit
end start
Source and binaries attached, must sit in the same folder as the current exe.