Jump to content

Recommended Posts

Posted

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

Posted

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)
Posted

$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
Posted

$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

this is the same ... :think:

$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.
  :)

Posted (edited)

edit: oops didnt see you post there thought you didnt get it :think:

$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 by thatsgreat2345

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
×
×
  • Create New...