Tiger Posted September 2, 2007 Share Posted September 2, 2007 Remove Files and Dirs from A #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.7.1 Author: Tiger Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Example Remove("C:\Test") Func Remove($s_target, $flag = 0) If Not StringInStr(StringRight($s_target, 1), "\") Then $s_target = $s_target & "\" $ffff = FileFindFirstFile($s_target & "*") While 1 $ffnf = FileFindNextFile($ffff) If @error Then ExitLoop ; Dir If StringInStr(FileGetAttrib($s_target & $ffnf), "D") Then DirRemove($s_target & $ffnf, $flag) ; File Else FileDelete($s_target & $ffnf) EndIf WEnd ; Close Search FileClose($ffff) EndFunc ;==>RemoveRemove.au3 My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
WolfWorld Posted September 2, 2007 Share Posted September 2, 2007 - -* pls. Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
Tiger Posted September 2, 2007 Author Share Posted September 2, 2007 What you mean with this "- -*" My UDFs:- _RegEnumKey Link to comment Share on other sites More sharing options...
jvanegmond Posted September 2, 2007 Share Posted September 2, 2007 Isn't this exactly the same as DirRemove("C:\Test",1) github.com/jvanegmond Link to comment Share on other sites More sharing options...
therks Posted September 2, 2007 Share Posted September 2, 2007 Almost, it looks like the difference is that his function will remove everything IN the directory, but leave the directory itself... Which would be the same as DirRemove('C:\Test', 1) DirCreate('C:\Test') My AutoIt Stuff | My Github 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