muguch
13-09-2012, 16:02
Код:
@echo off
set src=D:\2\
set dst=C:\2\
if not exist "%src%??_????_*.zip" (echo not exist %src%??_????_*.zip) else (
for /f "tokens=1,2,3,4 delims=_." %%I in ('dir /b "%src%??_????_*.zip"') do (
echo archive %src%%%I_%%J_%%K.%%L
if not exist "%dst%%%K-*" (echo not exist %dst%%%K-*) else (
for /f "tokens=1,2 delims=-" %%M in ('dir /b "%dst%%%K-*"') do (
echo extract to %dst%%%M-%%N
"%ProgramFiles%\7-Zip\7z.exe" x "%src%%%I_%%J_%%K.%%L" -oc:"%dst%%%M-%%N"
)
)
)
) »
archive d:\2\d2_0912_02.zip
extract to c:\2\02-*
7-Zip 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03
Processing archive: d:\2\d2_0912_02.zip
Error: Can not create output directory c:d:\2\02-*\
System error:
Синтаксическая ошибка в имени файла, имени папки или метке тома.
@echo off
set src=D:\2\
set dst=C:\2\
if not exist "%src%??_????_*.zip" (echo not exist %src%??_????_*.zip) else (
for /f "tokens=1,2,3,4 delims=_." %%I in ('dir /b "%src%??_????_*.zip"') do (
echo archive %src%%%I_%%J_%%K.%%L
if not exist "%dst%%%K-*" (echo not exist %dst%%%K-*) else (
for /f "tokens=1,2 delims=-" %%M in ('dir /b "%dst%%%K-*"') do (
echo extract to %dst%%%M-%%N
"%ProgramFiles%\7-Zip\7z.exe" x "%src%%%I_%%J_%%K.%%L" -oc:"%dst%%%M-%%N"
)
)
)
) »
archive d:\2\d2_0912_02.zip
extract to c:\2\02-*
7-Zip 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03
Processing archive: d:\2\d2_0912_02.zip
Error: Can not create output directory c:d:\2\02-*\
System error:
Синтаксическая ошибка в имени файла, имени папки или метке тома.