I'm creating a backup utility that zips all the files listed in a text file. I am using MS ACCESS as my front-end and 7-Zip for compression. These are the commands I am using:
7zG.exe a c:\Backup\backup.zip
@c:\temp\tmpFileList.txt
All the files are compressed without their path. Is there a way to include the path for each file in the zip file? Then when backup.zip
is extracted the files would be restored to their original folder structure.
Thanks
In this 7-zip forum thread, in which many people express their desire for this feature, 7-zip's developer Igor points to the FAQ question titled "How can I store full path of file in archive?" to achieve a similar outcome.
In short:
C:\
, one for D:\
, etc)cd /d C:\
)C:\Foo\Bar
becomes Foo\Bar
)7z a archive.7z @filelist
as before with this new file listThe command-line program for 7-Zip is 7z or 7za. Here's a helpful post on the options available. The -r (recurse) option stores paths.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With