Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have received some help from another forum but am running into a time crunch so I am asking for help from here to. Here is what I am trying to do.
I get 85 zip files everyday in one directory. The zip files are named yyyymmdd-(location code).zip. Location code is 1 through 85. The folder I need to unzip them into does not match the location code it is another name. So location 1 maps to 090909 location 2 maps to 9809876 and so on. I have an excel sheet which has both location codes. Column 1 is location codes 1-85 and column 2 is the location codes they are mapped to. Below is what I have so far but it doesn't work.
for /f "tokens=1,2,3 delims=-" %%A in ('dir /b *.zip') do "c:\program files\winzip\wzunzip.exe" -e -s %%A%-%B.%%C c:\test\%B\
The output I get is...
C:\test>"c:\program files\winzip\wzunzip.exe" -e -s 20080123B. c:\test\B\
As you can tell the zip file name is wrong. It should be 20080123-30.zip because that is the file in the directory. It also looks like the .ZIP extension is not showing up in the file name. Plus I need to make sure that each zip is extracted to the right folder under c:\test\.
I’m guessing I need to look at an input file to get the correct folder like I mentioned earlier in this post.Any help would be appreciated.

@echo off
setLocal EnableDelayedExpansionfor /f "tokens=1-2 delims=.-" %%A in ('dir /b *.zip') do (
echo unzip -e -s "%%A-%%B.zip" "c:\test\%%B\"
)
=====================================
If at first you don't succeed, you're about average.M2

![]() |
Cant get it to stop showi...
|
Inheritance not working a...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |