gjvail Posted August 9, 2005 Posted August 9, 2005 (edited) I have a problem that I am trying to over come. I have a folder that I want to either rename with a variable, being the days date, or move into a folder created with the day's date. I can automatically create a new folder named "(TODAY'S DATE)", but how would I write the script to move an existing folder into this one each day, as it will be different each day? or rename it. For example; C> MOVE ARCHIVED "(TODAY'S DATE)" Edited August 9, 2005 by gjvail
herewasplato Posted August 11, 2005 Posted August 11, 2005 ...but how would I write the script to move an existing folder<{POST_SNAPBACK}>Look at DirMove and @MDAY in the help file........... [size="1"][font="Arial"].[u].[/u][/font][/size]
gjvail Posted August 12, 2005 Author Posted August 12, 2005 I have a problem that I am trying to over come. I have a folder that I want to either rename with a variable, being the days date, or move into a folder created with the day's date.I can automatically create a new folder named "(TODAY'S DATE)", but how would I write the script to move an existing folder into this one each day, as it will be different each day?or rename it.For example; C> MOVE ARCHIVED "(TODAY'S DATE)" <{POST_SNAPBACK}>
gjvail Posted August 12, 2005 Author Posted August 12, 2005 (edited) <{POST_SNAPBACK}>Let me see if I can be more specific. I am interested in writing an auto script that will be:DirMove("C:\New Folder", "C:\Short date")The "Short date", would be atuo installed from the short date of the computer. Is there a way to write such a command? I know that you can run cmd and type in date /t and get this information, but then how would you tell it to copy this information in the Short date portion of the DirMove command each day?Or, perhaps there is a way to have it be sequential each day, such as;DirMove("C:\New Folder", "C:\New Folder_1")DirMove("C:\New Folder", "C:\New Folder_2")DirMove("C:\New Folder", "C:\New Folder_3"); each following day being a new number?Thank you so much for any and all suggestions. Edited August 12, 2005 by gjvail
seandisanti Posted August 12, 2005 Posted August 12, 2005 Let me see if I can be more specific. I am interested in writing an auto script that will be:DirMove("C:\New Folder", "C:\Short date")The "Short date", would be atuo installed from the short date of the computer. Is there a way to write such a command? I know that you can run cmd and type in date /t and get this information, but then how would you tell it to copy this information in the Short date portion of the DirMove command each day?Or, perhaps there is a way to have it be sequential each day, such as;DirMove("C:\New Folder", "C:\New Folder_1")DirMove("C:\New Folder", "C:\New Folder_2")DirMove("C:\New Folder", "C:\New Folder_3"); each following day being a new number?Thank you so much for any and all suggestions.<{POST_SNAPBACK}>plato already told you how to solve your problem. i don't think anyone is going to write the code for you; i know i'm not.
gjvail Posted August 12, 2005 Author Posted August 12, 2005 (edited) plato already told you how to solve your problem. i don't think anyone is going to write the code for you; i know i'm not.<{POST_SNAPBACK}>I am sorry, I did not mean to offend anyone.I am new to scripting and have already tried DirMove(C:\New File", "C:\ @MON, @MDAY, @YEAR)" I get @MON, @MDAY, @YEAR as the name of the new Dir/Folder. Is there a book on AutoIt that I can buy that will help explain how to use the macros?Again, I appologize for any offense at my questioning.Plato, especially to you. I wasn't trying to ignore your suggestions. Edited August 12, 2005 by gjvail
Arrrghmatey Posted August 12, 2005 Posted August 12, 2005 Try this: DirMove("C:\New File", "C:\" & @MON & @MDAY & @YEAR) Think of @MON as a variable. When you place it IN the quotes, it is just regular text, so it prints "@MON" exactly. You need to concatenate it with the string, using the & symbol
BigDod Posted August 12, 2005 Posted August 12, 2005 Try using$folder="foldername"DirMove("C:\New Folder", $folder) Substitute "foldername" for whatever you called your folder Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
Josbe Posted August 12, 2005 Posted August 12, 2005 (edited) I am sorry, I did not mean to offend anyone.I am new to scripting and have already tried DirMove(C:\New File", "C:\ @MON, @MDAY, @YEAR)" I get @MON, @MDAY, @YEAR as the name of the new file. Is there a book on AutoIt that I can buy that will help explain how to use the macros?Again, I appologize for any offense at my questioning.<{POST_SNAPBACK}>You don't need a book for to know about the macros.You only need concatenate the strings with the macros correctly.Example:DirMove(C:\New File", "C:\" & @MON & @MDAY & @YEAR )the result will be:"New File" it's moved to a directory named "08122005" located in "C:\"You could try separate the numbers too:"C:\" & @MON & '-' & @MDAY & '-' & @YEARresult: "C:\08-12-2005"Suggestion: Read and try the examples displayed in the helpfile. edit: typo Edited August 12, 2005 by Josbe AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
seandisanti Posted August 12, 2005 Posted August 12, 2005 I am sorry, I did not mean to offend anyone.I am new to scripting and have already tried DirMove(C:\New File", "C:\ @MON, @MDAY, @YEAR)" I get @MON, @MDAY, @YEAR as the name of the new Dir/Folder. Is there a book on AutoIt that I can buy that will help explain how to use the macros?Again, I appologize for any offense at my questioning.Plato, especially to you. I wasn't trying to ignore your suggestions.<{POST_SNAPBACK}>sorry if i was kind of abrupt before, but there is alot of people that ask for help without trying to help themselves, and then they ignore help they do get etc.string concatenation is where you're having your issue... when you surround a string with "" as you have, it is interpreted literally, or exactly as input. to include a variable, or a macro (like @mday) you have to add it to your string outside of the literal portion. example$this = "this" msgbox(0,"Concatenation",$this & " is concatenation. use this concept to include the variables in the string you want to use to set your folder name")
herewasplato Posted August 12, 2005 Posted August 12, 2005 Plato, especially to you. I wasn't trying to ignore your suggestions<{POST_SNAPBACK}>No apologies needed. It is I that should apologize for making such a brief post I just did not have time for more info than what I posted. I should have mentioned and perhaps illustrated concatenation (joinin stuff).It took me quite some time to learn how and when to concatenate things within AutoIt3. Im not a programmer and just have to pick up some things in the forum - by looking at others code. The AutoIt3 manual is the best that Ive ever seen, but a search on concatenate (or join) might not get you the knowledge needed to join macros.There is this one line from the help file:10 & 20 equals the string "1020" (& is used to join strings)You would have to make the leap (small that it is for some folks) to apply that to macros.I see that others have provided most of the info that you need to get started.Dont hesitate to post again if you run into any more roadblocks.later.. [size="1"][font="Arial"].[u].[/u][/font][/size]
gjvail Posted August 18, 2005 Author Posted August 18, 2005 No apologies needed. It is I that should apologize for making such a brief post I just did not have time for more info than what I posted. I should have mentioned and perhaps illustrated concatenation (joinin stuff).It took me quite some time to learn how and when to concatenate things within AutoIt3. Im not a programmer and just have to pick up some things in the forum - by looking at others code. The AutoIt3 manual is the best that Ive ever seen, but a search on concatenate (or join) might not get you the knowledge needed to join macros.There is this one line from the help file:10 & 20 equals the string "1020" (& is used to join strings)You would have to make the leap (small that it is for some folks) to apply that to macros.I see that others have provided most of the info that you need to get started.Dont hesitate to post again if you run into any more roadblocks.later..<{POST_SNAPBACK}>
gjvail Posted August 18, 2005 Author Posted August 18, 2005 <{POST_SNAPBACK}>I would so like to thank you all, (herewasplato, cameronsdad, Josbe, BigDod, and Arrrghmatey) for your help. I now having a working script that creates a new folder, transfers all of the .dss files into it, and then renames the folder to the current date. This will prevent any duplicate files or overwrites of critical information. I am doing this with ftp to a new server. I must admit, I had not checked back on this site until today, a little embarrassed to come back here, but was so excited by the help. Your help made it possible to solve all of my issues within a few hours. Concatenate is a word I will never forget.Thank you all again,g~
seandisanti Posted August 18, 2005 Posted August 18, 2005 I would so like to thank you all, (herewasplato, cameronsdad, Josbe, BigDod, and Arrrghmatey) for your help. I now having a working script that creates a new folder, transfers all of the .dss files into it, and then renames the folder to the current date. This will prevent any duplicate files or overwrites of critical information. I am doing this with ftp to a new server. I must admit, I had not checked back on this site until today, a little embarrassed to come back here, but was so excited by the help. Your help made it possible to solve all of my issues within a few hours. Concatenate is a word I will never forget.Thank you all again,g~ <{POST_SNAPBACK}>we're all glad to help man. and please don't let my first response disuade you from coming back and posting about any other questions, my apology for that post was sincere, i think i was just having a rough day that day or something...
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