Copy folders with date and time. (Backup)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Wazowski
Posts: 72
Joined: 16 Jun 2015, 21:04

Copy folders with date and time. (Backup)

09 Aug 2015, 21:33

Hello friends

I want to copy a folder to a backup but each time you do the combination to be copied have your date and time, I could help with something soon to see how to get started

I give you a small example of what I'm looking for

^b::

This in c:

Folder Original (Copy) ------> Folder Original 090815 (desktop)

I hope I have explained well what I want is a simple backup

Thank you
Last edited by Wazowski on 09 Aug 2015, 21:46, edited 2 times in total.
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Re: Copy folders with date and time. (Backup)

09 Aug 2015, 21:36

I'm sorry, I'm not getting what you mean. Specifically the part about a combination? Do you want to update the date/time stamp that makes up part of the name of the folder? Or are you adding a new folder and it has a time/date stamp in the name? Sorry, no 100% clear on your goal.
Wazowski
Posts: 72
Joined: 16 Jun 2015, 21:04

Re: Copy folders with date and time. (Backup)

09 Aug 2015, 21:44

Ok I'll try to be brief to avoid confusing, I want "Original Folder" when making the combination is copied to the desktop with date and time

Create a new folder with the original name or only the date and time
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Re: Copy folders with date and time. (Backup)

09 Aug 2015, 21:54

I'm going to have to pass this to someone else because I hate to say, I do not understand what you're looking for. I'm guessing this is being run through a translator and it is losing something in the process. I'm sorry. Best of luck!
Wazowski
Posts: 72
Joined: 16 Jun 2015, 21:04

Re: Copy folders with date and time. (Backup)

09 Aug 2015, 22:38

Ok men, just want to make a backup I have a folder on drive C: to the desktop with date and time.
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Re: Copy folders with date and time. (Backup)

09 Aug 2015, 23:18

So you have folder "Folder A" located at "C:\Folder A". You want to make a copy of it called "Folder A 20150808" on the desktop? Is that right? If so, is the name of the folder always the same, or will you need to choose the folder each time you want to make a backup/copy of it?
Wazowski
Posts: 72
Joined: 16 Jun 2015, 21:04

Re: Copy folders with date and time. (Backup)

09 Aug 2015, 23:29

All your questions are yes, always be copied from C: \ Folder A to Folder A 20150808 (desktop) always
aaffe
Posts: 192
Joined: 16 Jan 2014, 04:23

Re: Copy folders with date and time. (Backup)

10 Aug 2015, 00:23

Something like this?

Code: Select all

FileCopyDir,C:\FolderA,%A_Desktop%\FolderA_%A_YYYY%%A_MM%%A_DD%
gilliduck
Posts: 265
Joined: 06 Oct 2014, 15:01

Re: Copy folders with date and time. (Backup)

10 Aug 2015, 00:26

Looks like someone beat me to it, but here's what I was going to post:

In that case I would recommend reading up on:

To copy a folder
http://ahkscript.org/docs/commands/FileCopyDir.htm

To get the built in variable for the desktop
http://ahkscript.org/docs/Variables.htm#os

To format the current time into whatever style you want
http://ahkscript.org/docs/commands/FormatTime.htm

Those three things are basically all you need to build a very simple script to do what you're asking (at least insofar as I understand your request).

Happy coding!
Wazowski
Posts: 72
Joined: 16 Jun 2015, 21:04

Re: Copy folders with date and time. (Backup)

10 Aug 2015, 06:42

Fine men is what I wanted and what starting your help try to improve a little in terms of renowned
Wazowski
Posts: 72
Joined: 16 Jun 2015, 21:04

Re: Copy folders with date and time. (Backup)

10 Aug 2015, 16:53

Excellent works perfectly, now and could add that each time a change is detected folder A folder do the support B and when it detects the change makes the backup in 30 seconds

This is my code up time

Code: Select all

^t::
FileCopyDir,C:\Users\bicho\Documents\My Games,%A_Desktop%\Terraria %A_YYYY%%A_MM%%A_DD% %A_Hour%%A_Min%
return
aaffe
Posts: 192
Joined: 16 Jan 2014, 04:23

Re: Copy folders with date and time. (Backup)

11 Aug 2015, 01:26

Yes you can. Just try it, post your code and surely it will be corrected.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada and 310 guests