Используйте цикл «for» и подстановочный знак
for %f in (file.txt*) do 7za.exe a %f.7z %f
Смотрите ниже: обратите внимание на другую версию 7 Zip Это все то же самое.
C:\temp>for %f in (file.txt*) do "C:\Program Files\7-Zip\7z.exe" a %f.7z %f
C:\temp>"C:\Program Files\7-Zip\7z.exe" a file.txt.20150220.7z file.txt.20150220
7-Zip 17.00 beta (x64) : Copyright (c) 1999-2017 Igor Pavlov : 2017-04-29
Scanning the drive:
1 file, 0 bytes
Creating archive: file.txt.20150220.7z
Add new data to archive: 1 file, 0 bytes
Files read from disk: 0
Archive size: 106 bytes (1 KiB)
Everything is Ok
C:\temp>"C:\Program Files\7-Zip\7z.exe" a file.txt.original.7z file.txt.original
7-Zip 17.00 beta (x64) : Copyright (c) 1999-2017 Igor Pavlov : 2017-04-29
Scanning the drive:
1 file, 0 bytes
Creating archive: file.txt.original.7z
Add new data to archive: 1 file, 0 bytes
Files read from disk: 0
Archive size: 106 bytes (1 KiB)
Everything is Ok
C:\temp>"C:\Program Files\7-Zip\7z.exe" a file.txt_20150230.7z file.txt_20150230
7-Zip 17.00 beta (x64) : Copyright (c) 1999-2017 Igor Pavlov : 2017-04-29
Scanning the drive:
1 file, 0 bytes
Creating archive: file.txt_20150230.7z
Add new data to archive: 1 file, 0 bytes
Files read from disk: 0
Archive size: 106 bytes (1 KiB)
Everything is Ok