I'm writing a batch file on Windows which gets one argument: a zip file name that was created with 7-zip.
This file contains a single MySQL backup file inside, say backup.sql
.
I would like to restore the database given this zip file.
So, first I extract it to a temporary directory like this:
path_to_7zip\7z e "%~1" -otemp_dir
And now is my question: How could I know the name of the extracted file (i.e. backup.sql
) ?
I would like to write something like this:
path_to_mysql\mysql < extracted_file_name
(where extracted_file_name
should be backup.sql
)
What should I write instead of extracted_file_name
if I don't know the file name that is inside the zip file ?