Diana (Cda) Posted January 2, 2007 Share Posted January 2, 2007 I have this line in a script and it does a great job: FileCopy("C:\Documents and Settings\Application Data\Microsoft\Outlook\*.*", "C:\Documents and Settings\Desktop\Outlook-\*.*") I get this type of result below. Although the script copied about 7 files, I'm just showing 2 here: outcmd.dat MS Exchange Settings.RWZ Is it possible, instead, to get the same but with a date and time stamp at the end before the extension on when the copy was made, like this (with the extension re-copied)?: outcmd.dat - 2006.01.02.Tu., 17h28.dat MS Exchange Settings.RWZ - 2006.01.02.Tu., 17h28.RWZ I have another AI script, kindly provided by a poster here a year or so ago, and it gives me the date format I need, if that's any help -- although the code below goes to the clipboard and I need instead to get the code to put the info re date, as well as the time, in each filename as per the example just above: ; ; AutoIt v3.0 ; SoundPlay ("D:\AUTOIT\Scripts\WAVs\Robotz Menu Popup.wav") #include <date.au3> $thisday = StringMid("Sn,Mn,Tu,Wd,Th,Fr,Sa", StringInStr("SunMonTueWedThuFriSat", _DateDayOfWeek(@WDAY,1) ), 2) ClipPut(@YEAR & '.' & @MON & '.' & @MDAY & '.' & $thisday) Sleep(500) Exit ; finishedTIA! Thanks! :"> Link to comment Share on other sites More sharing options...
Zedna Posted January 2, 2007 Share Posted January 2, 2007 (edited) Use _FileListToArray()something like this my old piece of code for renaming, in your case with FileCopy:#Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray(".","*.zip",1) If @Error = 0 And IsArray($FileList) Then _ArraySort($FileList,0,1) For $j = 1 to UBound($FileList) - 1 $name = $FileList[$j] $header = FileRead ($name,3) If $header = "Rar" Then FileMove($name, StringReplace($name, ".zip",".rar")) Next EndIfInside For Loop change name of file with your date logic... Edited January 2, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Diana (Cda) Posted January 3, 2007 Author Share Posted January 3, 2007 This looks interesting. I can't make heads or tails of it, though. It looks like it might need 2 external au3 files (?). And rar and zip are mentioned. I'm not sure I have the knowledge to do the drastic editing to get this to work from my simple filecopy to what is needed to just add the date and time before the extension to the copied files. <sigh> Well, I'll just have to keep looking for a solution. Thanks for this, though. Not your fault that I couldn't figure out how to get it to work. Thanks! 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