addictedtofunk Posted October 25, 2006 Share Posted October 25, 2006 $FileList=_FileListToArray("M:\Backup") _ArrayDisplay( $Filelist, "Class List of Active Window" ) $max = _ArrayMax ( $Filelist, 1) MsgBox(0,'Max Index String value',$Filelist[$max]) FileCopy("M:\Backup\" & "$Filelist[$max]" , "C:\Test\" & "$Filelist[$max]") 1Make an array with filelist in it 2. Display array e.t.c The file copy code doesn't work, can someone tell me whats wrong with it(i am trying to copy the last entry in the array) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 25, 2006 Moderators Share Posted October 25, 2006 (edited) 1. Name your thread titles descriptive of what it is you need or are talking about. That helps others when searching, and people that would have no clue on how to help, not to waste their time.2. Use AutoIt code tags when posting code (forum ettiquette).3. You need to check out what _ArrayMax() really does.4. You can't surround a variable with quotes (SciTe should have thrown that error FileCopy("M:\Backup\" & "$Filelist[$max]"5. To return the last element in the array ... try this:#include <file.au3> $FileList = _FileListToArray("M:\BackUp", "*.*", 1) FileCopy("M:\Backup\" & $FileList[UBound($FileList) - 1], "C:\Test\" & $FileList[UBound($FileList) - 1], 9) Edited October 25, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
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