2

Today I lost my whole Far Cry 3 save game suddenly. So now I want to backup it's save game folder automatically on a certain period of time using windows task scheduling.

I want to include date and time in archive file name.
Here is my command

C:\>"C:\Program Files\7-Zip\7z" a -r "D:\FC3\%DATE:~7,2%.%DATE:~4,2%.%DATE:~-4% %TIME% Backup".7z  "C:\ProgramData\Orbit\46"

For formatting purpose, I followed this question on superuser

I am getting log when executing this command

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Scanning

Creating archive D:\FC3\24.02.2013 17:52:10.62 Backup.7z


Error:
7-Zip cannot open file
D:\FC3\24.02.2013 17:52:10.62 Backup.7z
The filename, directory name, or volume label syntax is incorrect.



System error:
Unspecified error

If I use a simple file name like "D:\abc". It would work.

Please help. Where I am going wrong..?

fixer1234
  • 28,064
shashwat
  • 244

1 Answers1

1

Here's a way to generate a timestamp filename.

echo creating "D:\FC3\%DATE:/=.%%TIME::=.% Backup.7z"

Sample Output:

creating "D:\FC3\02.24.2013 7.34.45.85 Backup.7z"
martineau
  • 4,573