Jump to content
Sign in to follow this  
AuToItItAlIaNlOv3R

Delete the contents of a folder

Recommended Posts

AuToItItAlIaNlOv3R

Hi to all,this is the firsth post in this forum!.Exuse me for a bad english but i'm italian :P...

I wante to know how to delete all the contents of a folder.For exsample a would delete the contents of the windows prefecth (C:\WINDOWS\Prefetch)...how to i can delete the all contents of folder...thanks

Share this post


Link to post
Share on other sites
i542

Did you even opened helpfile?

FileDelete ( "C:/YourFolderPath/*.*" )

I can do signature me.

Share this post


Link to post
Share on other sites
ProgAndy

Or use

DirRemove( "C:/YourFolderPath/" )
DirCreate( "C:/YourFolderPath/" )

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
AuToItItAlIaNlOv3R

i'dont wont delete the folder but all the contents of the folder!

Share this post


Link to post
Share on other sites
UltraFine

i'dont wont delete the folder but all the contents of the folder!

already explained by i542, Read the help file for FileDelete() DirRemove()

and as he told you before you can delete the files as follow

Example:

FileDelete ("C:/YourFolderPath/FileName.Extention" )
FileDelete ("C:/YourFolderPath/FileX.txt" ) ;~ Drive letter+Folder Name+File Name+ File ExtentionoÝ÷ Ù©Ýü¨»§¶ÚzW­y©e~)^²)Ú²øuú%uêí©ÚºÚ"µÍ[Q[]H
    ][ÝÐÎÖ[ÝÛ]Ê][ÝÈ
Edited by L0veUK

Share this post


Link to post
Share on other sites
AdmiralAlkex

I hope \Prefetch only was a example because those files are not supposed to be deleted. Their purpose is to speed up application loading times and cleaning that folder will only increase the time to boot windows and start apps.

Share this post


Link to post
Share on other sites
archgriffin

I just wanted to make a quick note, there are many cases where people just want to delete the files within a folder and not the folder itself because of file permissions on the folder itself and what it has set for inheritance on the way down the chain.

I'm not sure why, but I just felt like that needed saying. :P


"Human kind cannot gain anything without first giving something in return, to obtain; something of equal value must be lost."The Help File is truly your friend.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.