genbadger Posted July 29, 2009 Posted July 29, 2009 Hey guys! Im new to autoit, so maybe someone can help. What im trying to do is everytime i plug my f: drive, prompt me to ask if i want to back up, then if i hit yes, make a new folder on the f: drive with that days date as the name, then copy my documents folder into it. Any help is very much appreciated, thanks for your time -genbadger
PsaltyDS Posted July 29, 2009 Posted July 29, 2009 On 7/29/2009 at 10:09 PM, 'genbadger said: Hey guys! Im new to autoit, so maybe someone can help. What im trying to do is everytime i plug my f: drive, prompt me to ask if i want to back up, then if i hit yes, make a new folder on the f: drive with that days date as the name, then copy my documents folder into it. Any help is very much appreciated, thanks for your time-genbadgerLook up the DirCopy() function in the help file. Use the _NowCalc() function or just the @YEAR/@MON/@MDAY macros to assemble the folder name.And welcome to AutoIt. >_< Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Guest AX5 Posted July 29, 2009 Posted July 29, 2009 DirCopy ( "source dir", "dest dir" [, flag] )ExampleDirCopy(@MyDocumentsDir, "C:\Backups\MyDocs", 1)
genbadger Posted July 30, 2009 Author Posted July 30, 2009 ok... i think im kinda doing this right, but its naming the folder & _NowDate.... i want to get the naming right before i do the dircopy... please clear it up for me i have no clue wat to do... thanks for the advice u guys gave me already its put me on the right track. this is all i have and im really having trouble with it iv been workin on it for hours thanks #include <Date.au3> DirCreate("E:\ & _NowDate") dircopy("@mydocuments", "E:\
Malkey Posted July 30, 2009 Posted July 30, 2009 On 7/30/2009 at 1:10 AM, 'genbadger said: ok... i think im kinda doing this right, but its naming the folder & _NowDate.... i want to get the naming right before i do the dircopy... please clear it up for me i have no clue wat to do... thanks for the advice u guys gave me already its put me on the right track. this is all i have and im really having trouble with it iv been workin on it for hours thanks #include <Date.au3> DirCreate("E:\ & _NowDate") dircopy("@mydocuments", "E:\ This may help. ; #include <Date.au3> DirCreate("E:\" & @YEAR & @MON & @MDAY) DirCopy(@MyDocumentsDir & "\MyMusic", "E:\" & @YEAR & @MON & @MDAY) ConsoleWrite(@MyDocumentsDir & "\MyMusic" & @CRLF) ConsoleWrite("E:\" & @YEAR & @MON & @MDAY & @CRLF) ConsoleWrite("E:\" & _NowDate() & @CRLF) ;
somdcomputerguy Posted July 30, 2009 Posted July 30, 2009 (edited) On 7/30/2009 at 2:48 AM, 'Malkey said: This may help. ; #include <date.au3> DirCreate("E:\" & @YEAR & @MON & @MDAY) DirCopy(@MyDocumentsDir & "\MyMusic", "E:\" & @YEAR & @MON & @MDAY) ConsoleWrite(@MyDocumentsDir & "\MyMusic" & @CRLF) ConsoleWrite("E:\" & @YEAR & @MON & @MDAY & @CRLF) ConsoleWrite("E:\" & _NowDate() & @CRLF) ; Well the code in my first reply didn't work, so I deleted it. Then I came up with this - #Include <date.au3> $text = StringReplace("C:\" & _NowDate(), "/", "_") DirCreate($text) but your code is much better looking..<br><br>BTW, I used C because E is my CD drive..<br></date.au3></date.au3> Edited July 30, 2009 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Malkey Posted July 30, 2009 Posted July 30, 2009 On 7/30/2009 at 2:56 AM, 'snowmaker said: Well the code in my first reply didn't work, so I deleted it. Then I came up with this - #Include <date.au3> $text = StringReplace("C:\" & _NowDate(), "/", "_") DirCreate($text) but your code is much better looking..<br><br>BTW, I used C because E is my CD drive..<br></date.au3></date.au3> Off topic snowmaker I have noticed & inserted into your script, and a lot more inserted into my quoted script. I tried to duplicate this in "Test thread" http://www.autoitscript.com/forum/index.php?showtopic=98043&view=findpost&p=712266 without success. Of course, while "&" is there, your example script will not work. Malkey
somdcomputerguy Posted July 30, 2009 Posted July 30, 2009 On 7/30/2009 at 4:57 AM, 'Malkey said: Off topicsnowmakerI have noticed & inserted into your script, and a lot more inserted into my quoted script.I tried to duplicate this in "Test thread"http://www.autoitscript.com/forum/index....p?showtopic=98043&view=findpost&p=712266without success.Of course, while "&" is there, your example script will not work. MalkeyThe 'ampersand' symbols were replaced with '&' after I edited the post. In the original post, the code displayed correctly. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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