This is what is happening -
Code: Select all
:MAIN
C:\7za.exe e C:\Downloads\Prevalidation\*.zip -oC:\Downloads\Prevalidation\*.psa
dir "C:\Downloads\Prevalidation\" > C:\Downloads\list_of_psa_files.txt
del C:\Downloads\list_of_file_tsrcvd.csv
FOR /F "tokens=1,2,3,5 skip=7" %%A in (C:\Downloads\list_of_psa_files.txt) DO ( @echo %%A %%B %%C %%D >>
C:\Downloads\list_of_file_tsrcvd.csv )
exit
The file named list_of_psa_files.txt now shows only one file which is the original zip file, whereas all my extracted files are inside the sub-folder created by 7-zip.
1. Can't I have 7-zip extract the files to the same folder where the zip file is located?
2. In case the answer to the above question is a No, how can I pass the sub-folder name in my dos script at run time (I dont know whats the sub-folder name 7-zip is going to create, since it is based on the original zip file name, and that changes) so that I can scan through the folder and list down the file names of all the files extracted there along with their timestamps.
Thanks. Much appreciate your help.
Sanders.