@echo off
setlocal
::本批处理可以任意改名
::如果UltraISO是安装在“C:\Program files\UltraISO”目录,可以把本批处理放在任意位置,然后双击安装!
::如果UltraISO不是安装在“C:\Program files\UltraISO”目录,则需要把本批处理复制到UltraISO安装目录下,再双击安装!
::http://www.ezbsystems.com/ultraiso/cmdline.htm(UltraISO命令行参数)
set exepath=%~dp0
if not exist "%exepath%\UltraISO.exe" set exepath=%Programfiles%\UltraISO
pushd %exepath%\ 2>nul || echo 找不到UltraISO的安装目录,按任意键退出...... && pause>nul && goto ext
if not exist "%exepath%\UltraISO.exe" echo 找不到Ultraiso.exe,按任意键退出...... && pause>nul && goto ext
if "%~1"=="" goto choice
if exist "%Userprofile%\sendto\制作ISO.lnk" goto start
if exist "%Appdata%\Microsoft\Windows\SendTo\制作ISO.lnk" goto start
:choice
cls
echo.
echo.
set /P cho=安装请输入y,卸载请输入n,输入其它字符则视为放弃:
echo %cho%|findstr /i "^[yn]*$">nul || goto ext
goto %cho%
:y
cls
echo.
echo.
echo 正在复制文件,请稍等......
copy /y "%~fs0" "%exepath%\" > nul || cls&&echo.&&echo 请以管理员权限运行......&&pause>nul&&goto ext
echo.
echo 正在创建快捷方式到“发送到”右键菜单......
echo [Version]>setup.inf
echo Signature="$CHICAGO$">>setup.inf
echo [DefaultInstall]>>setup.inf
echo UpdateInis=AddLink>>setup.inf
echo [AddLink]>>setup.inf
echo setup.ini, progman.groups,,"group1=""%%16393%%\""">>setup.inf
echo setup.ini,group1,,"""制作ISO"",""""""%%01%%\%~nx0"""""",""%%01%%\UltraISO.exe"",,,""%%01%%\""">>setup.inf
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\setup.inf
del /a /f /q setup.inf >nul 2>nul
echo.
echo 完成安装!!
echo.
echo 按任意键退出!!
echo.
echo.
echo.
echo.
echo.
echo 现在可以在任意文件上右击“发送到”制作ISO了......
echo.
echo 如果需要制作成可引导的ISO文件,
echo.
echo 需将引导文件改名为loader.bin,放到要压缩的文件夹内,
echo.
echo 或放到二级目录“EZBOOT\”、“BOOT\” 文件夹内......
echo.
echo 如果要压缩单个文件,则需要放到此文件的同级目录......&echo.&pause>nul&goto ext
:start
if "%~1"=="ext" goto main
start /min %~fs0 ext %* & goto ext
:main
shift
if "%~1"=="" goto ext
set file=-file
if "%~x1"=="" set file=-directory
set myvolume="%~n1"
set mydirectory="%~1"
set mypath=%~dp1
for /f "delims=" %%i in ("%~1") do (
set route=%%i
set filename=
call :separate
)
:separate
if not "%route:~-1%"=="\" (
set filename=%route:~-1%%filename%
set route=%route:~0,-1%
goto separate
) else (
goto makeiso
)
:makeiso
set boot=%mypath%loader.bin
if "%file%"=="-directory" call :setboot
rem "UltraISO.exe -imax -volume %myvolume% -optimize -directory %mydirectory% -output "%mypath%%filename%.iso" -joliet -jlong -checksum -md5 -silent"
UltraISO.exe -imax -volume %myvolume% -optimize %file% %mydirectory% -output "%mypath%%filename%.iso" -lowercase -joliet -jlong -checksum -md5 -bootfile "%boot%"
goto ext
:setboot
if exist "%mypath%%filename%\loader.bin" set boot=%mypath%%filename%\loader.bin && goto :eof
if exist "%mypath%%filename%\ezboot\loader.bin" set boot=%mypath%%filename%\ezboot\loader.bin && goto :eof
if exist "%mypath%%filename%\boot\loader.bin" set boot=%mypath%%filename%\boot\loader.bin && goto :eof
goto :eof
:n
cls
del /a /f /q "%Userprofile%\sendto\制作ISO.lnk" >nul 2>nul
del /a /f /q "%Appdata%\Microsoft\Windows\SendTo\制作ISO.lnk" >nul 2>nul
echo.
echo.
echo 成功卸载!!
echo.
echo 按任意键退出!!&echo.&pause>nul
:ext
endlocal&exit
@echo off
setlocal
::本批处理可以任意改名
::如果UltraISO是安装在“C:\Program files\UltraISO”目录,可以把本批处理放在任意位置,然后双击安装!
::如果UltraISO不是安装在“C:\Program files\UltraISO”目录,则需要把本批处理复制到UltraISO安装目录下,再双击安装!
::http://www.ezbsystems.com/ultraiso/cmdline.htm(UltraISO命令行参数)
set exepath=%~dp0
if not exist "%exepath%\UltraISO.exe" set exepath=%Programfiles%\UltraISO
pushd %exepath%\ 2>nul || echo 找不到UltraISO的安装目录,按任意键退出...... && pause>nul && goto ext
if not exist "%exepath%\UltraISO.exe" echo 找不到Ultraiso.exe,按任意键退出...... && pause>nul && goto ext
if "%~1"=="" goto choice
if exist "%Userprofile%\sendto\制作ISZ.lnk" goto start
if exist "%Appdata%\Microsoft\Windows\SendTo\制作ISZ.lnk" goto start
:choice
cls
echo.
echo.
set /P cho=安装请输入y,卸载请输入n,输入其它字符则视为放弃:
echo %cho%|findstr /i "^[yn]*$">nul || goto ext
goto %cho%
:y
cls
echo.
echo.
echo 正在复制文件,请稍等......
copy /y "%~fs0" "%exepath%\" > nul || cls&&echo.&&echo 请以管理员权限运行......&&pause>nul&&goto ext
echo.
echo 正在创建快捷方式到“发送到”右键菜单......
echo [Version]>setup.inf
echo Signature="$CHICAGO$">>setup.inf
echo [DefaultInstall]>>setup.inf
echo UpdateInis=AddLink>>setup.inf
echo [AddLink]>>setup.inf
echo setup.ini, progman.groups,,"group1=""%%16393%%\""">>setup.inf
echo setup.ini,group1,,"""制作ISZ"",""""""%%01%%\%~nx0"""""",""%%01%%\UltraISO.exe"",,,""%%01%%\""">>setup.inf
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 .\setup.inf
del /a /f /q setup.inf >nul 2>nul
echo.
echo 完成安装!!
echo.
echo 按任意键退出!!
echo.
echo.
echo.
echo.
echo.
echo 现在可以在任意文件上右击“发送到”制作ISZ了......
echo.
echo 如果需要制作成可引导的ISZ文件,
echo.
echo 需将引导文件改名为loader.bin,放到要压缩的文件夹内,
echo.
echo 或放到二级目录“EZBOOT\”、“BOOT\” 文件夹内......
echo.
echo 如果要压缩单个文件,则需要放到此文件的同级目录......&echo.&pause>nul&goto ext
:start
if "%~1"=="ext" goto main
start /min %~fs0 ext %* & goto ext
:main
shift
if "%~1"=="" goto ext
set file=-file
if "%~x1"=="" set file=-directory
set myvolume="%~n1"
set mydirectory="%~1"
set mypath=%~dp1
for /f "delims=" %%i in ("%~1") do (
set route=%%i
set filename=
call :separate
)
:separate
if not "%route:~-1%"=="\" (
set filename=%route:~-1%%filename%
set route=%route:~0,-1%
goto separate
) else (
goto makeiso
)
:makeiso
set boot=%mypath%loader.bin
if "%file%"=="-directory" call :setboot
rem UltraISO.exe -volume %myvolume% %file% %mydirectory% -compress 0 -password "%x%" -output "%mypath%%filename%.isz" -joliet -lowercase -checksum -md5
rem UltraISO.exe -volume %myvolume% %file% %mydirectory% -compress 6 -output "%mypath%%filename%.isz" -joliet -lowercase -checksum -md5
UltraISO.exe -imax -volume %myvolume% -optimize %file% %mydirectory% -compress 5 -output "%mypath%%filename%.isz" -lowercase -joliet -jlong -checksum -md5 -bootfile "%boot%"
goto ext
:setboot
if exist "%mypath%%filename%\loader.bin" set boot=%mypath%%filename%\loader.bin && goto :eof
if exist "%mypath%%filename%\ezboot\loader.bin" set boot=%mypath%%filename%\ezboot\loader.bin && goto :eof
if exist "%mypath%%filename%\boot\loader.bin" set boot=%mypath%%filename%\boot\loader.bin && goto :eof
goto :eof
:n
cls
del /a /f /q "%Userprofile%\sendto\制作ISZ.lnk" >nul 2>nul
del /a /f /q "%Appdata%\Microsoft\Windows\SendTo\制作ISZ.lnk" >nul 2>nul
echo.
echo.
echo 成功卸载!!
echo.
echo 按任意键退出!!&echo.&pause>nul
:ext
endlocal&exit
欢迎光临 EZB 论坛 (http://ultraiso.net/ezbbbs/) | Powered by Discuz! 6.1.0 |