Jump to content

unistall func


Recommended Posts

hi 
;unistall func

Send("!{F4}")

sleep(300)
_unistall()
Func _unistall()
    Local $sCmdFile
    FileDelete(@TempDir & "\delete1.bat")
    $sCmdFile = 'TASKKILL /IM "'& @ScriptName & '"'& @CRLF _
    & 'rd /s /q "' & @WorkingDir& '"'& @CRLF _
     & 'del ' & @TempDir & "\delete1.bat" & @CRLF _
     & 'exit' 
    FileWrite(@TempDir & "\delete1.bat", $sCmdFile)
    Run(@ComSpec & ' /c "' & @TempDir & '\delete1.bat"', "", @SW_HIDE);   <=dont work 
EndFunc
;but delete1.bat file work
;but autoit code" Run(@ComSpec & ' /c "' & @TempDir & '\delete1.bat"', "", @SW_HIDE)" dont work why?
hi

;but delete1.bat file work

;but autoit code" Run(@ComSpec & ' /c "' & @TempDir & '\delete1.bat"', "", @SW_HIDE)" dont work why?

thank you for help me

Edited by mesale0077
Link to comment
Share on other sites

try this

If @Compiled = 1 Then
    Msgbox(0,'',"I'll delete myself."&@CRLF&@AutoItExe)
    $batch_file = @TempDir&'\lol.bat'
    $cmd = _
    'taskkill /PID '&@AutoItPID&@CRLF& _
    'del "'& @AutoItExe &'"'&@CRLF& _
    'del %0'
    FileWrite($batch_file,$cmd)
    ShellExecute($batch_file,'','','',@SW_HIDE)
Else
    MsgBox(0,'','You need to compile this script to see the effect!.')
EndIf
Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...