koalaz2004 Posted April 15, 2006 Posted April 15, 2006 Im backing up server info and the old bakups take a tun of time to delete and there just simple files , but I wanted o know is there a script I could use to delete old .bk files? or just delete files? Thanks also is there a way to rename files too? Thanks
Thatsgreat2345 Posted April 15, 2006 Posted April 15, 2006 it would be realllly easy if they were all in a certain folder but give me a sec
Simucal Posted April 15, 2006 Posted April 15, 2006 Check FileMove() in the help file for renaming.. you effectively overwrite the files with themselves and their new name if I understand correctly. Also check out, FileDelete(), DirRemove(), FileRecyle(), etc AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Developers Jos Posted April 15, 2006 Developers Posted April 15, 2006 Here is a script example that can delete files older than and remove empty directories i posted a while ago... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Thatsgreat2345 Posted April 15, 2006 Posted April 15, 2006 $path = FileSelectFolder("Select a Folder to search","C:\") $file1 = "*.bk" $search = FileFindFirstFile($path & $file1) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) filedelete($file) WEnd ; Close the search handle FileClose($search) that might work
Developers Jos Posted April 15, 2006 Developers Posted April 15, 2006 $path = FileSelectFolder("Select a Folder to search","C:\") $file1 = "*.bk" $search = FileFindFirstFile($path & $file1) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) filedelete($file) WEnd ; Close the search handle FileClose($search) that might workthis is the same ... $path = FileSelectFolder("Select a Folder to search","C:\") $file1 = "*.bk" FileDelete($Path & "\" & $file1) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
koalaz2004 Posted April 15, 2006 Author Posted April 15, 2006 Wow guys that was fast thanks for the help
Thatsgreat2345 Posted April 15, 2006 Posted April 15, 2006 (edited) edit: oops didnt see you post there thought you didnt get it $path = FileSelectFolder("Select a Folder to search","C:\") $file1 = "*.bk" FileDelete($Path & "\" & $file1) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) filedelete($file) WEnd ; Close the search handle FileClose($search) Edited April 15, 2006 by thatsgreat2345
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