Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently running a batch file that backs up all my files created or modified within the past 24 hours using an old version of Winzip. I use 7 zip for a lot of archiving and would like to be able to use it for this purpose but it does not have switches that let you select files based on their date/time stamp. I do NOT want to copy files to a directory based on their time stamp and archive them form there. Any suggestions?

share|improve this question

http://ss64.com/nt/forfiles.html

and

http://www.dotnetperls.com/7-zip-examples ->

 forfiles  /c "7za a -t7z @fname.7z @file" /d -1
share|improve this answer
1  
Mind expanding these links? Link only answers may be deleted. – soandos Jul 15 '12 at 18:19

Wth some research I came up with something that should work...

forfiles  /c "cmd /c 7z u -t7z [setup an empty 7z file].7z @path" /d -1 /s
share|improve this answer

Close but will archive files older than one day with those switches here is the syntax for current day (with a date added to the output file :

set hr=%time:~0,2%
if "%hr:~0,1%" equ " " set hr=0%hr:~1,1%

Rem  - compress data that is from current day

forfiles /p "c:\<path of what to backup>" /d 0 /c "cmd /c C:\<Location of 7zip>\7za u -tzip D:\<Where you want archive saved>\Archive_%date:~-4,4%%date:~-10,2%%date:~-7,2%_%hr%%time:~3,2%%time:~6,2%.zip @PATH -mmt"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .