Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

and ->

 forfiles  /c "7za a -t7z @fname.7z @file" /d -1
share|improve this answer
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, @PATH -mmt"
share|improve this answer

Your Answer


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.