Solved

How to use WinZip Or DOS Batch file to copy file with current date

Posted on 2009-04-05
4
607 Views
Last Modified: 2012-05-06
I am using this WinZip command to zip files to be transferred to a remote back up site.  Does anyone know if I could include a parameter that would only include the current date to that command? I keep 7 days of backups, but I only want to transfer the current day. Thanks In Advance
WinZip Command

wzzip -a backup.zip *.bak
 

xcopy Command

xcopy "\\ComputerName\Directory" "D:\Backups" /D /I /E /Y /C /V /R /Z /K /H

Open in new window

0
Comment
Question by:rjackmanwyn
  • 2
  • 2
4 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 24073790
What is the exact filename?  Does it contain today's date?
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 24073812
for example, if the file is named   2009-04-05.bak,  then you can use this as the filename in the winzip command:

wzzip -a backup.zip  %date:~10,4%-%date:~4,2%-%date:~7,2%.bak
0
 

Author Comment

by:rjackmanwyn
ID: 24073813
The file name varies as there are several back ups in this directory. It does contain words such as [database]backup_20090405[Time].bak with the date as YYYYMMDD and time
0
 

Author Closing Comment

by:rjackmanwyn
ID: 31566855
Thank You. With your help I figured it out.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need help editing script 3 65
Enable Intel-VT on a IBM Yoga 7 30
Batch Login Script - Update default homepage 8 42
fso.FolderExists("\\server\HiddenFolder$") 4 51
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now