Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What would be the easiest way of zipping/raring/arjing a directory with a timestamp for a name?

share|improve this question
    
And, you know, it would make a lot of sense to use a YYYYMMDD date format so the backups are listed in chronological order (and it's easy to see if the one you want is there). –  pavium Dec 30 '09 at 2:37
    
@pavium - of course. –  ldigas Dec 30 '09 at 3:42

2 Answers 2

up vote 2 down vote accepted

On the console you can do

rar a -r "backup-%DATE%.rar" "C:\Path\To\Directory"

If you also want the the time in the archive name, things get more complicated since %TIME% usually contains characters illegal for a file name (like :). To remove the colons form %TIME%, you could use some wired for-loop syntax:

FOR /F "tokens=1,2,3 delims=:" %i IN ("%TIME%") DO (
      rar a -r "backup-%DATE%-%i.%j.%k.rar" "C:\Path\To\Directory"
   )

(See for /? for details on what this does.)

share|improve this answer

Assuming you want a quick Explorer-based pointy-clicky solution, here's the way I'd use:

  1. First, for quick zipping, use WinZip's Add To Zip Explorer context menu option on the folder.
  2. Then, use Synesis Software's Shell Extensions Date Renamer context menu option on the resulting zip archive:

Date Renamer

I would imagine there are other solutions that are equally short but use different shell extensions.

share|improve this answer
1  
Of course, I'm curious if there's a single-step pointy-clicky solution that doesn't involve coding it oneself ;-) –  Chris W. Rea Dec 30 '09 at 1:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.