Sign in to follow this  
Followers 0
gjvail

Naming Dir/folders

14 posts in this topic

#1 ·  Posted (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)"

:whistle:

Edited by gjvail

Share this post


Link to post
Share on other sites



...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]

Share this post


Link to post
Share on other sites

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)"

:whistle:

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by gjvail

Share this post


Link to post
Share on other sites

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.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by gjvail

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Try using

$folder="foldername"

DirMove("C:\New Folder", $folder)

Substitute "foldername" for whatever you called your folder



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 & '-' & @YEAR

result: "C:\08-12-2005"

Suggestion: Read and try the examples displayed in the helpfile. :whistle:

edit: typo

Edited by Josbe

Share this post


Link to post
Share on other sites

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")

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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}>

Share this post


Link to post
Share on other sites

<{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~ :whistle:

Share this post


Link to post
Share on other sites

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~  :whistle:

<{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...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0