mohd Posted March 5, 2008 Share Posted March 5, 2008 بسم الله الرحمن الرحيم hi how can i delete all files in one folders ? i know that if i want to delete any file i use filedelete("") but i dont know how can i delete all the files is a one folder with the script or in any folder ?? thanks Link to comment Share on other sites More sharing options...
LIMITER Posted March 5, 2008 Share Posted March 5, 2008 (edited) You can use this (i didn't test the code): #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray(@DesktopDir);put here your dir For $i = 1 To $FileList[0] FileDelete($FileList[$i] Next Edited March 5, 2008 by LIMITER Link to comment Share on other sites More sharing options...
weaponx Posted March 5, 2008 Share Posted March 5, 2008 You can use this (i didn't test the code): #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray(@DesktopDir);put here your dir For $i = 1 To $FileList[0] FileDelete($FileList[$i] Next I am perplexed at this. FileDelete(@DeskTopDir & "\New Folder\*.*") Link to comment Share on other sites More sharing options...
mohd Posted March 7, 2008 Author Share Posted March 7, 2008 thanks for u the code i use this code FileDelete(@DeskTopDir & "\New Folder\*.*") and its runing thank for all Link to comment Share on other sites More sharing options...
mohd Posted March 7, 2008 Author Share Posted March 7, 2008 but i want to ask .. if the folder is not on desk top what can i do ? if the folder on © the name of folder is (1) what is the script ? Link to comment Share on other sites More sharing options...
GEOSoft Posted March 7, 2008 Share Posted March 7, 2008 but i want to ask .. if the folder is not on desk top what can i do ? if the folder on © the name of folder is (1) what is the script ?#Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray("C:\1\*.*);put here your dir For $i = 1 To $FileList[0] FileDelete($FileList[$i] Next George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
weaponx Posted March 7, 2008 Share Posted March 7, 2008 #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray("C:\1\*.*);put here your dir For $i = 1 To $FileList[0] FileDelete($FileList[$i] Next GEO - I'm shocked that you reposted the code that I pointed out as redundant. Link to comment Share on other sites More sharing options...
GEOSoft Posted March 7, 2008 Share Posted March 7, 2008 GEO - I'm shocked that you reposted the code that I pointed out as redundant.Give me a break!! It's 05:30 here and I'm on my first coffee. OK enough excuses. Of course you are correct (not to mention there is a mistake in the code I posted).Of course if mohd is removing all the files in the folder then he might as well remove the whole folder while he's at it.DirRemove("C:\1\", 1)If he still needs the folder then follow that withDirCreate("C:\1\") George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
weaponx Posted March 7, 2008 Share Posted March 7, 2008 Hey this is a team effort, I can't have you making the all the big plays. Link to comment Share on other sites More sharing options...
GEOSoft Posted March 7, 2008 Share Posted March 7, 2008 Hey this is a team effort, I can't have you making the all the big plays.And you're the coach so put me on the bench until I've had more coffee and decided if I should just go back to bed. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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