<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>奋斗Blog &#187; RAR</title>
	<atom:link href="http://www.fendou.info/tag/rar/feed" rel="self" type="application/rss+xml" />
	<link>http://www.fendou.info</link>
	<description>Wordpress&#124;Web2.0&#124;Network&#124;Twitter&#124;Search Engine</description>
	<lastBuildDate>Sat, 14 Aug 2010 15:27:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BAT版RAR分割工具</title>
		<link>http://www.fendou.info/os/bat-rar-tool.html</link>
		<comments>http://www.fendou.info/os/bat-rar-tool.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 14:47:55 +0000</pubDate>
		<dc:creator>dev</dc:creator>
				<category><![CDATA[操作系统]]></category>
		<category><![CDATA[bat]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[分割]]></category>
		<category><![CDATA[工具]]></category>
		<category><![CDATA[批处理]]></category>

		<guid isPermaLink="false">http://www.fendou.info/?p=889</guid>
		<description><![CDATA[一般论坛或者网络硬盘在上传文件的时候都做了大小限制，必须在上传前先给文件打包分割成规定上传大小。WinRAR虽然有分割压缩的功能，但是如果本身要分割的文件就是已经压缩过的就比较麻烦了，还的先解压缩然后再用WinRAR分割压缩，而且还需事先计算好分割块的大小，虽然WinRAR有命令行打包的功能，但是我想那功能没几个人会用。]]></description>
			<content:encoded><![CDATA[<p>一般论坛或者网络硬盘在上传文件的时候都做了大小限制，必须在上传前先给文件打包分割成规定上传大小。WinRAR虽然有分割压缩的功能，但是如果本身要分割的文件就是已经压缩过的就比较麻烦了，还的先解压缩然后再用WinRAR分割压缩，而且还需事先计算好分割块的大小，虽然WinRAR有命令行打包的功能，但是我想那功能没几个人会用。</p>
<p>最近用网络U盘用比较多，而且上传的都是比较大的压缩文件，用WinRAR解了在压实在太麻烦，于是找到了这个NB的BAT版RAR分割工具。这个分割工具是深度论坛推出的RAR 自动分卷压缩助手，是用BAT写的小程序，调用WinRAR来分割文件，配置简单可操作性强。</p>
<p>BAT版RAR分割工具代码在下面，直接COPY然后保存为.bat文件就可以用了。<span id="more-889"></span></p>
<pre>
::   深度技术论坛《RAR 自动分卷压缩助手》  

::  -------------------------------- 使用方法 -----------------------------
::
::     将需要打包的单个文件或者单个目录，托拽到本文件图标上面，
::     Auto_rar.bat 会自动调用 rar.exe， 将提交的文件或者目录分割成指定大小
::     的分卷rar压缩文件，并保存在指定的目录中。
::     对于提交的 7zip、rar、jpg 文件，Auto_rar.bat 只分卷打包，不压缩。
::
::  xxsz  http://www.deepin.org  Email: szwluo@126.com  QQ: 283779584

@echo off

:: --------------------------------------------------------------------
::          设定文件分割之后放置的目录、设定要分割之后每卷的大小
::
::    set BBSpath，设定文件分割之后放置的目录，结尾不能有“\”
::
::    set size=500k  表示分割成每卷 500k 大小；
::    set size=2m    表示分割成每卷 2M 大小；
::    set size=      没有赋值时，表示不分卷。
::                   注意：“k”、“m”不能大写，一定要小写，
::
::    注意：赢政BBS 表示的附件可以是512K，实际只能上传 500K 的附件
:: --------------------------------------------------------------------
set size=500k
set BBSpath=c:\bbsup

if {%1}=={} goto readme

:: --------------------------------------------------------------------
::              定位 rar.exe 目录位置，请确认已经安装了Winrar
:: --------------------------------------------------------------------

del %temp%\Auto_rar_readme.txt >nul
del %temp%\$cd$.txt >nul
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.rar\ShellNew" /v "FileName">%temp%\$cd$.txt
for /f "skip=4 tokens=3 delims=	" %%i in (%temp%\$cd$.txt) do set rarpath=%%~dpi
del %temp%\$cd$.txt

if exist "%rarpath%rar.exe" goto rarfile
if exist "%ProgramFiles%\winrar\rar.exe" set rarpath=%ProgramFiles%\winrar\
if not exist "%ProgramFiles%\winrar\rar.exe" goto norar

:: --------------------------------------------------------------------
::           开始使用 rar.exe 分卷压缩目标文件
:: --------------------------------------------------------------------
:rarfile
:: ----------------------------------------------------
::    修正了文件名中包含“;” 出错的问题 wz
:: ----------------------------------------------------
FOR /F "delims=" %%i IN ('echo %*') DO set name=%%~ni
md %BBSpath%
md %BBSpath%\%name%
set ext=%~x1
:: -----------------------------------------------------------------
::     -m<n>   设置压缩模式:
::   -m0 存储；-m1 最快；-m2 较快； -m3 标准； -m4   较好； -m5 最好
:: ------------------------------------------------------------------
set level=5
if {%ext%}=={.7z} set level=0
if {%ext%}=={.7Z} set level=0
if {%ext%}=={.rar} set level=0
if {%ext%}=={.RAR} set level=0
if {%ext%}=={.jpg} set level=0
if {%ext%}=={.JPG} set level=0

@echo -------------------- %name% 分割纪录 -------------------- >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo. >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo %date%>>%BBSpath%\%name%\%name%_分割纪录.txt
@echo %time% 分割开始>>%BBSpath%\%name%\%name%_分割纪录.txt
@echo. >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo 分割的原始文件为：>>%BBSpath%\%name%\%name%_分割纪录.txt
@echo ├→ %1>>%BBSpath%\%name%\%name%_分割纪录.txt
@echo │ >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo 分割生成了以下文件，每个文件大小为 %size% ：>>%BBSpath%\%name%\%name%_分割纪录.txt
:: --------------------
::     压缩开始了！
:: --------------------
"%rarpath%rar.exe" a  -ep1 -m%level% -v%size% %BBSpath%\%name%\%name%.rar %1
@FOR /r %BBSpath%\%name% %%I in (*.rar) DO (
@echo ├─ %%I>>%BBSpath%\%name%\%name%_分割纪录.txt
)
@echo │ >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo %time% 分割完成。>>%BBSpath%\%name%\%name%_分割纪录.txt
@echo. >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo 将以上文件上传到 BBS 吧！>>%BBSpath%\%name%\%name%_分割纪录.txt
@echo. >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo ----------------------------- www.deepin.org -------------------------- >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo. >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo. >>%BBSpath%\%name%\%name%_分割纪录.txt
@echo. >>%BBSpath%\%name%\%name%_分割纪录.txt
start explorer %BBSpath%\%name%
set name=
goto end

:: --------------------------------------------------------------------
::           系统中找不到 rar.exe 时候的错误提示
:: --------------------------------------------------------------------
:norar
del %temp%\Auto_rar_readme.txt >nul
@echo ================ 错误提示：================>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 在您的电脑中没有找到 rar.exe 。>>%temp%\Auto_rar_readme.txt
@echo 请确认您已经安装了 Winrar 。>>%temp%\Auto_rar_readme.txt
@echo 请确认 %rarpath%rar.exe 文件是否存在。>>%temp%\Auto_rar_readme.txt
@echo 重新安装 Winrar 可以修复这个问题。>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo ============== 错误提示结束 ==============>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo         《RAR 自动分卷压缩助手》      www.deepin.org >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 问：这个小东西可以干啥呢？>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo    答： 使用 Winrar 自动将文件或者目录进行分卷打包成指定的大小，>>%temp%\Auto_rar_readme.txt
@echo         拖一下鼠标就可以搞定，方便快捷，上传到 BBS 更方便！ >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 问：既然已经安装了 Winrar，还要这个干啥？>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo    答： Winrar 不能对已经压缩过的文件进行分卷打包。>>%temp%\Auto_rar_readme.txt
@echo         这个小东西却可以，这个小工具操作也比winrar方便快捷。>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo -------------------------------- 使用方法 ----------------------------- >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo    将需要打包的单个文件或者单个目录，托拽到 Auto_rar.bat 上面，>>%temp%\Auto_rar_readme.txt
@echo    Auto_rar.bat 会自动调用 rar.exe， 将提交的文件或者目录分割成指定大小>>%temp%\Auto_rar_readme.txt
@echo    的分卷rar压缩文件，并保存在指定的目录中。 >>%temp%\Auto_rar_readme.txt
@echo    对于提交的 7zip、rar、jpg 文件，Auto_rar.bat 只分卷打包，不压缩。 >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo        提示： 用记事本打开 Auto_rar.bat 文件，修改以下参数>>%temp%\Auto_rar_readme.txt
@echo             ┏━━━━━━━━━━━━━┓>>%temp%\Auto_rar_readme.txt
@echo             ┃   set size=500k          ┃>>%temp%\Auto_rar_readme.txt
@echo             ┃   set BBSpath=c:\bbsup   ┃>>%temp%\Auto_rar_readme.txt
@echo             ┗━━━━━━━━━━━━━┛>>%temp%\Auto_rar_readme.txt
@echo        可以设置分卷的大小，以及分卷文件保存的位置。>>%temp%\Auto_rar_readme.txt
@echo        Auto_rar.bat 文件中包含详细的设置指南。>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo ----------------------------- www.deepin.org -------------------------- >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 注意问题：>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 1、这个小工具需要调用 rar.exe，确认您已经安装了 Winrar。>>%temp%\Auto_rar_readme.txt
@echo 2、提交的文件名或者目录名不能包含有“;”小分号。>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt

start notepad.exe %temp%\Auto_rar_readme.txt
goto end

:: --------------------------------------------------------------------
::                    没有提交文件时，弹出的使用说明
:: --------------------------------------------------------------------
:readme
del %temp%\Auto_rar_readme.txt >nul
@echo         《RAR 自动分卷压缩助手》      www.deepin.org >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 问：这个小东西可以干啥呢？>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo    答： 使用 Winrar 自动将文件或者目录进行分卷打包成指定的大小，>>%temp%\Auto_rar_readme.txt
@echo         拖一下鼠标就可以搞定，方便快捷，上传到 BBS 更方便！ >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 问：既然已经安装了 Winrar，还要这个干啥？>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo    答： Winrar 不能对已经压缩过的文件进行分卷打包。>>%temp%\Auto_rar_readme.txt
@echo         这个小东西却可以，这个小工具操作也比winrar方便快捷。>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo -------------------------------- 使用方法 ----------------------------- >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo    将需要打包的单个文件或者单个目录，托拽到 Auto_rar.bat 上面，>>%temp%\Auto_rar_readme.txt
@echo    Auto_rar.bat 会自动调用 rar.exe， 将提交的文件或者目录分割成指定大小>>%temp%\Auto_rar_readme.txt
@echo    的分卷rar压缩文件，并保存在指定的目录中。 >>%temp%\Auto_rar_readme.txt
@echo    对于提交的 7zip、rar、jpg 文件，Auto_rar.bat 只分卷打包，不压缩。 >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo        提示： 用记事本打开 Auto_rar.bat 文件，修改以下参数>>%temp%\Auto_rar_readme.txt
@echo             ┏━━━━━━━━━━━━━┓>>%temp%\Auto_rar_readme.txt
@echo             ┃   set size=500k          ┃>>%temp%\Auto_rar_readme.txt
@echo             ┃   set BBSpath=c:\bbsup   ┃>>%temp%\Auto_rar_readme.txt
@echo             ┗━━━━━━━━━━━━━┛>>%temp%\Auto_rar_readme.txt
@echo        可以设置分卷的大小，以及分卷文件保存的位置。>>%temp%\Auto_rar_readme.txt
@echo        Auto_rar.bat 文件中包含详细的设置指南。>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo ----------------------------- www.deepin.org---------------------- >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 注意问题：>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo 1、这个小工具需要调用 rar.exe，确认您已经安装了 Winrar。>>%temp%\Auto_rar_readme.txt
@echo 2、提交的文件名或者目录名不能包含有“;”小分号。>>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt
@echo. >>%temp%\Auto_rar_readme.txt

start notepad.exe %temp%\Auto_rar_readme.txt
goto end

:end
set size=
set BBSpath=
set name=
set rarpath=
set level=
</pre>
<h3>相关日志</h3><ul><li><a href="http://www.fendou.info/ad/ad-add-user.html" title="如何批量添加域用户 2010.08.14">如何批量添加域用户</a>(3)</li>
<li><a href="http://www.fendou.info/os/open-remote-desktop-in-cmd.html" title="批处理开启远程桌面 2009.12.9">批处理开启远程桌面</a>(2)</li>
</ul>
	标签：<a href="http://www.fendou.info/tag/bat" title="bat" rel="tag">bat</a>, <a href="http://www.fendou.info/tag/rar" title="RAR" rel="tag">RAR</a>, <a href="http://www.fendou.info/tag/%e5%88%86%e5%89%b2" title="分割" rel="tag">分割</a>, <a href="http://www.fendou.info/tag/%e5%b7%a5%e5%85%b7" title="工具" rel="tag">工具</a>, <a href="http://www.fendou.info/tag/%e6%89%b9%e5%a4%84%e7%90%86" title="批处理" rel="tag">批处理</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.fendou.info/os/bat-rar-tool.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
