Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Windows Batch to automate backup

Hi:

We would like to save a copy of a qvw file on a daily basis. I was thinking about writing a windows batch job that will automate the copying of the files. The following works fine but I would like to modify it a little.

copy d:\src\finename.qvw s:\dest\%random%-x.qvw

The modification I would like concerning the above is the following: instead of a random number I would like to have a timestamp (YYYYMMDD) to ease the process of finding the appropriate file back.

Does anybody have an idea how to accomplish that?

Jochem



3 Replies
Not applicable
Author

SET YYYYMMDD=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%
copy d:\src\filename.qvw s:\test\%YYYYMMDD%-x.qvw

Rgds,

Sébastien

Not applicable
Author

Hi,

You can copy your file and rename it:

copy d:\src\finename.qvw s:\dest\

ren s:\dest\filename.qvw filename%DATE:/=-%.qvw

mihaiturturica
Partner - Contributor III
Partner - Contributor III

Hi,

You can use this:

COPY d:\src\filename.qvw s:\test\%date:~10,4%-%date:~4,2%-%date:~7,2%_filename.qvw

Attention to date format. This is US format.

Regards,

Mihai