Sign in to follow this  
Followers 0
mohd

how can i do the delete

10 posts in this topic

بسم الله الرحمن الرحيم

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

Share this post


Link to post
Share on other sites



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\*.*")

Share this post


Link to post
Share on other sites

thanks for u the code i use this code

FileDelete(@DeskTopDir & "\New Folder\*.*")

and its runing

thank for all

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

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!"

Share this post


Link to post
Share on other sites

#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.

Share this post


Link to post
Share on other sites

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 with

DirCreate("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!"

Share this post


Link to post
Share on other sites

Hey this is a team effort, I can't have you making the all the big plays.

Share this post


Link to post
Share on other sites

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!"

Share this post


Link to post
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
Sign in to follow this  
Followers 0