- Sep
- 9
- 0
I have a bunch of zip files in a directory. I would like to extract each archive to a subdirectory with the same name as the archive. Can the unzip command create directories? I tried creating the subdirectories first but I you can't have a file and directory with same name in the same directory. If I have a full path to a file, how do strip off just the file exension? For example, how would get rid of .txt from "C:\Program Files\JPSoft\TCMD22\readme.txt" to yield "C:\Program Files\JPSoft\TCMD22\readme"?
Code:
set filepath=E:\archive
for /r %filepath %x in (*.zip) (
echo %x
echo %x\%@filename["%x"]
md "%x\%@filename["%x"]"
)