1

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..?

Community
  • 1
  • 1
shashwat
  • 7,851
  • 9
  • 57
  • 90

1 Answers1

3

I got the point

File Names can not have :

I fixed the code by replacing colon with .

C:\>"C:\Program Files\7-Zip\7z" a -r "D:\FC3\%DATE:~7,2%.%DATE:~4,2%.%DATE:~-4% %TIME:~0,2%.%TIME:~3,2%.%TIME:~-5% Backup".7z  "C:\ProgramData\Orbit\46"
shashwat
  • 7,851
  • 9
  • 57
  • 90