mesale0077 Posted June 22, 2010 Share Posted June 22, 2010 (edited) 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 June 22, 2010 by mesale0077 Link to comment Share on other sites More sharing options...
MiserableLife Posted June 22, 2010 Share Posted June 22, 2010 maybe this? ShellExecute(@TempDir & '\delete1.bat','','','',@SW_HIDE) Link to comment Share on other sites More sharing options...
mesale0077 Posted June 22, 2010 Author Share Posted June 22, 2010 (edited) thank you but ,bat file dont work folder delete ??? delete demoprogram file but dont delete demopro folder Edited June 22, 2010 by mesale0077 Link to comment Share on other sites More sharing options...
MiserableLife Posted June 22, 2010 Share Posted June 22, 2010 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 More sharing options...
mesale0077 Posted June 22, 2010 Author Share Posted June 22, 2010 (edited) ok but workingdır folder delete "@WorkingDir&" delete ,file delete ok but folder dont delete folder ,ı want folder "@WorkingDir" delete thank you for help me Edited June 22, 2010 by mesale0077 Link to comment Share on other sites More sharing options...
MiserableLife Posted June 22, 2010 Share Posted June 22, 2010 $handle = FileFindFirstFile(@ScriptDir&"\*.*") While 1 $file = FileFindNextFile($handle) If @error Then ExitLoop FileDelete($file) WEnd FileClose($handle) Link to comment Share on other sites More sharing options...
mesale0077 Posted June 22, 2010 Author Share Posted June 22, 2010 To completely remove the folder, this like it func DirRemove(@WorkingDir, 1) ı want with bat file delete (@WorkingDir) folder but dont work thank you for help me Link to comment Share on other sites More sharing options...
MvGulik Posted June 22, 2010 Share Posted June 22, 2010 (edited) whatever Edited February 7, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now