Jump to content

Recommended Posts

  • Developers
Posted

could any one tell me the code to it ive looked in the help files and i dont have a clue on how to do it

thanks

did you even try to search ?

This has been asked so many times ... the key is _SelfDelete() :whistle:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

I always use Larry's SuiCide() function, I think the name is quite funny :whistle:

; IMPORTANT MAKE A COPY OF SCRIPT BEFORE DELETION
; Deletes the running script
; Author Larry

SuiCide()

Func SuiCide()
    $SC_File = @TEMPDIR & "\suicide.bat"
    FileDelete($SC_File)
    $SC_batch = 'loop:' & @CRLF & 'del "' & @SCRIPTFULLPATH & '"'  & @CRLF & _
         'ping -n 1 -w 250 zxywqxz_q' & @CRLF & 'if exist "' & @SCRIPTFULLPATH & _
        '" goto loop' & @CRLF & 'del suicide.bat' & @CRLF

    FileWrite($SC_File,$SC_batch)
    Run($SC_File,@TEMPDIR,@SW_HIDE) 
    Exit
EndFunc
  • 4 weeks later...
Posted

@ChrisL

the function you are using doesn't delete the program folder

i'm using a similar approach

CODE
Func DeleteProgram ()

If FileExists (@TempDir &"\RemoveMe.cmd") then

FileClose (@TempDir &"\RemoveMe.cmd")

FileDelete (@TempDir &"\RemoveMe.cmd")

EndIf

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "@echo off")

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", ":loop")

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "del """ & $InstallPath & "\*.*"" /S/Q")

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "if exist """ & $InstallPath & "\Uninstall.exe"" goto loop")

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", ":Loop2")

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "rd """ & $InstallPath & """ /Q")

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "if exist """ & $InstallPath & "\NUL"" goto loop2")

FileWriteLine (@TEMPDIR & "\RemoveMe.cmd", "del " & @TEMPDIR & "\RemoveMe.cmd")

Run (@TEMPDIR & "\RemoveMe.cmd", @TempDir, @SW_HIDE)

Exit

EndFunc

This wil also remove the folder

Best regards,Emiel Wieldraaijer

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...