augustspies Posted March 10, 2011 Share Posted March 10, 2011 Hi guys, Another newbie in the forums looking for some help with a script. basically what I would like to do is create a script that will copy a folder to another location and then rename the copied folder with the current date. this will be done daily. I have been able to copy the folder using: DirCopy("D:\Test", "C:\Test\", 0) however i am unsure how to rename the folder to current date. i tried: DirCopy("D:\Test", "C:\Test\_NowDate", 0) but that just names the folder to _NowDate Would really appreciate your input thx Link to comment Share on other sites More sharing options...
AutoitNew94 Posted March 10, 2011 Share Posted March 10, 2011 (edited) You can set the date and time to a variable and then replace the _NowDate with the variable or just replace _NowDate with whatever parameters you want. The date is unquoted by the way. "C:\Test\" &@mon&@mday&@year $TimeStamp = "\"&@mon&@mday&@year&@hour&@min&@sec Hopefully that helps. Cheers- Edited March 10, 2011 by AutoitNew94 "You're not smart enough for me to open my inbox, so stop sending me mail." Link to comment Share on other sites More sharing options...
smartee Posted March 10, 2011 Share Posted March 10, 2011 Hi guys, Another newbie in the forums looking for some help with a script. basically what I would like to do is create a script that will copy a folder to another location and then rename the copied folder with the current date. this will be done daily. I have been able to copy the folder using: DirCopy("D:\Test", "C:\Test\", 0) however i am unsure how to rename the folder to current date. i tried: DirCopy("D:\Test", "C:\Test\_NowDate", 0) but that just names the folder to _NowDate Would really appreciate your input thx you can try something like #include <Date.au3> DirCopy("D:\Test", "C:\" & StringReplace(_NowDate(), "/", "-"), 0) Link to comment Share on other sites More sharing options...
augustspies Posted March 10, 2011 Author Share Posted March 10, 2011 (edited) wow you guys are quick:) appreciate the help - AutoitNew94 & smartee I will give it a try. seems as though there are multiple ways of doing the same thing huh? I'm really new at autoit this is my first time actually trying to create a script instead of just recording mouse movements. I came up with this and it seems to work: used the DirMove instead of DirCopy? DirMove("D:\Test\", "C:\Test\" & @YEAR & "-" & @MON & "-" & @MDAY) Edited March 10, 2011 by augustspies Link to comment Share on other sites More sharing options...
augustspies Posted March 10, 2011 Author Share Posted March 10, 2011 hey AutoitNew94,smartee or anyone else I was wondering if I could get your help with something else. I have a folder for example that has other folders in it: D:\Test\ -folder 1 -folder 2 -folder 3 -etc I would like to move 1 folder every day into: C:\Test\ how could I set this up? 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