cascius 2 Posted August 23, 2004 Share Posted August 23, 2004 Hi guys, I'm new to Autoit and I love it so far! I've been working on a script that gather's information from one of my computers and post them into a file on an ftp server and everything works great. My only problem is that at this point it always upload this file with the same name. Therefore I lose all the rpevious versions of it... What I'd like to do is to be able to rename that reg.dat file into something like this for example: mm-dd-hh-mm.dat (hh and mm are hour and minutes). I'm sure this is not very hard to achieve. Then how would I incorpoate this into the following part of the script: $file="reg.dat" ;** Create ftp parameters file FileOpen ( "ftp.ftp", 2 ) FileWriteline( "ftp.ftp", "#######" ) FileWriteline( "ftp.ftp", "#######" ) FileWriteline( "ftp.ftp", "binary" ) FileWriteline( "ftp.ftp", "send " & $file ) FileWriteline( "ftp.ftp", "quit" ) fileclose("ftp.ftp") ;** Run ftp program RunWait(@ComSpec & " /c " & 'ftp -s:ftp.ftp ftp.Angelfire.com', "", @SW_HIDE) exit The part that would be relevant is <$file="reg.dat"> Can anyone help me? Thanks, -Cascius Link to post Share on other sites
this-is-me 7 Posted August 23, 2004 Share Posted August 23, 2004 (edited) $file=@MDAY & @MON & @YEAR & @HOUR & @MIN & @SEC & ".dat" Edited August 23, 2004 by this-is-me Who else would I be? Link to post Share on other sites
cascius 2 Posted August 23, 2004 Author Share Posted August 23, 2004 (edited) Thanks, Unfortunately I'm still having problems with this. The file end up being named exactly like this: "@MDAY & @MON & @YEAR & @HOUR & @MIN & .dat" without values for mday, etc... Here's what I tryed: FileOpen("@MDAY & @MON & @YEAR & @HOUR & @MIN & .dat", 2) FileWriteLine("@MDAY & @MON & @YEAR & @HOUR & @MIN & .dat", "VAR1= " & $VAR1) FileClose("@MDAY & @MON & @YEAR & @HOUR & @MIN & .dat.dat") $FILE="@MDAY & @MON & @YEAR & @HOUR & @MIN & .dat" FileOpen("ftp.ftp", 2) FileWriteLine( "ftp.ftp", "######") FileWriteLine( "ftp.ftp", "######") FileWriteLine( "ftp.ftp", "binary") FileWriteLine( "ftp.ftp", "send " & $FILE) FileWriteLine( "ftp.ftp", "quit") FileClose("ftp.ftp") RunWait(@ComSpec & " /c " & 'ftp -s:ftp.ftp ftp.Angelfire.com', "", @SW_HIDE) What I'm I doing wrong? Another way would just be to rename the file i add before "reg.dat" into "@MDAY & @MON & @YEAR & @HOUR & @MIN & .dat". But i couldn't find a function that renames files... I'm clueless! Thanks in advance, -Cascius Edited August 23, 2004 by cascius Link to post Share on other sites
cascius 2 Posted August 23, 2004 Author Share Posted August 23, 2004 Nevermind, I found how to rename and everything works great! I just had to know that Filemove was also used to rename files... Lol. Anyway, thanks for the help. Everything works flawlessly now! -Cascius Link to post Share on other sites
this-is-me 7 Posted August 24, 2004 Share Posted August 24, 2004 (edited) Why didn't you copy what I had as I had it? Do you know how to copy and paste? The reason it didn't work is because you put it in wrong. Edited August 24, 2004 by this-is-me Who else would I be? Link to post Share on other sites
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