Jump to content
Sign in to follow this  

FileGetTime Help

Recommended Posts


UPDATE: Found my error I forgot the "\" in my paths.

If anyone has any suggestions on how to improve this fell free to make comments.

Also, how do you find the file extention? Anyone know?

I'm writing a simple program to copy all files in a dir and rename them to the date modified. I'm getting an error and was hoping someone to tell me what i'm doing wrong.

DirCopy("C:\Backups", "C:\Backups1",1)
$search = FileFindFirstFile("C:\Backups1\*.*") 

While 1
    $file = FileFindNextFile($search) 
    If @error Then 
    $t =  FileGetTime('C:\Backups1' & $file, 0, 0) ;<---- error on this line
    $yyyymd = $t[1] & "_" & $t[2] & "_" & $t[0] 
    FileMove('C:\Backups1' & $file, 'C:\Backups1' & $yyyymd & '.txt')

; Close the search handle

error code:

:\autoit\FileCreatedDate.au3 (32) : ==> Subscript used with non-Array variable.:

$yyyymd = $t[1] & "_" & $t[2] & "_" & $t[0]

$yyyymd = $t^ ERROR

>Exit code: 1 Time: 1.481

Edited by Smiley357

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