@REM ------- BEGIN demo.bat ----------------
@setlocal
@echo off
for /F %%i in ('dir /b *.zip') do call :do_extract "%%i"
goto :eof
:do_extract
echo %1
mkdir %1.extracted
c:unzip -d %1.extracted %1
del %1
一直以为Windows下的代码支持很差。现在知道了,还是很差,但不是一点没有。上面的代码用.bat做文件扩展名,直接运行可以批量解压zip文件。
如果用c-shell 写的话会很接近。
#! /bin/csh
foreach f (`ls *.zip`)
mkdir $f.ext
unzip -d $f.ext $f
rm -f $f
end
Windows下的代码运行
所有跟帖:
•
回复:还有人用BAT,创世纪的东东.
-chinomango-
♂
(0 bytes)
()
11/28/2009 postreply
22:21:06
•
阶级斗争要天天讲,月月讲,年年讲。
-wooddiy-
♂
(194 bytes)
()
11/29/2009 postreply
07:39:10
•
哈哈:Powershell
-逗蟋蟀-
♀
(11 bytes)
()
11/29/2009 postreply
10:45:46
•
oh come on. Windows just "learned" too much
-wooddiy-
♂
(151 bytes)
()
11/29/2009 postreply
21:06:17
•
New version of Mac is Unix! Job just modify it
-wandering_nightcat-
♂
(0 bytes)
()
11/30/2009 postreply
03:51:15