Jump to content

Naming Dir/folders


Recommended Posts

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
Link to comment
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}>

Link to comment
Share on other sites

<{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
Link to comment
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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
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 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
Link to comment
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")
Link to comment
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]

Link to comment
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}>

Link to comment
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:

Link to comment
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...
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...