Jump to content

condicional copy


tempman
 Share

Recommended Posts

Hi,

I am trying to write script which copy *.log files from dir1 to dir2

if *.log file size iz less then 50000 bites

This should work:

#include <File.au3>
$DIR = FileSelectFolder("SELECT","")
$SAVE_DIR = FileSelectFolder("SAVE","",1)
$FILES = _FileListToArray($DIR,"*.TXT")
For $INDEX = 1 To $FILES[0]
    $SOURCE = $DIR & "\" & $FILES[$INDEX]
    If FileGetSize($SOURCE) < 50000 Then
        FileCopy($SOURCE,$SAVE_DIR)
    EndIf
Next

When the words fail... music speaks.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...