AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

instant backup of file selection

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
firace



Joined: 08 Feb 2009
Posts: 28

PostPosted: Tue Mar 09, 2010 10:36 am    Post subject: instant backup of file selection Reply with quote

hi,

i was looking for a way to select files in explorer and quickly
back them up with a hotkey. at first i thought it wouldn't
be possible without using 3rd party tools but then i came up
with the following solution, based on the sendto system folder.

usage: select one or more files to back up, and hit CTRL+SHIFT+B.


the solution is made of 2 separate, tiny ahk files:

backup-sendto.ahk:
needs to be compiled to EXE and placed in the sendto folder.


Code:

bkpdir = C:\data-bkup

FileCreateDir, %bkpdir%
Loop, %0%
{
    fpath := %A_Index%
    splitpath, fpath,,, fext, fname
   
   FileCopy, %fpath%, %bkpdir%\%fname%-%A_NOW%.%fext%
}

msgbox backup done!




backup-hotkey.ahk:
this has the code for the hotkey.

Code:

^+b::
send {appskey}nb
return



please note, there's no error-checking or advanced features -
at this time it's just a little proof of concept.
hope someone finds this useful - let me know if any comments.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group