Jump to content

Recommended Posts

Posted

I would like to copy all files from one directory to another where file name starts with number (0-9).

Your help will be appreciated.

Regards

Posted

I would like to copy all files from one directory to another where file name starts with number (0-9).

Your help will be appreciated.

Regards

For $i = 0 to 9
    If FileExists("C:\" & $i & "*.*") Then
       FileCopy("C:\" & $i & "*.*", "D:\mydir\*.*")
    EndIf
Next

Replace C:\ with source Drive and Path, D:\mydir\ with Target Drive and Path.

Posted

For $i = 0 to 9
    If FileExists("C:\" & $i & "*.*") Then
       FileCopy("C:\" & $i & "*.*", "D:\mydir\*.*")
    EndIf
Next

Replace C:\ with source Drive and Path, D:\mydir\ with Target Drive and Path.

Cool! Thank you a lot!

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