HH的脾气是目标文件夹路径不支持带空格或引号,所以变复杂了点,否则一行命令足矣

其他的代码没啥难度,重在实用

批处理代码如下:


复制代码 代码如下:

::主命令格式如下

::hh -decompile 目标文件夹 chm源文件名

::目标文件夹及文件名均不能加引号,目标文件夹不能含空格

@echo off & setlocal enabledelayedexpansion

title CHM 文档解包批处理 By SunTB

if exist “%~dpnx1” (

set file=%~dpnx1

set file_pth=%~dp1

set file_pth=!file_pth:~0,-1!

set file_name=%~nx1

) else (

echo.&echo 请输入 CHM 文件完整路径:

echo.&set /p file=

set file=!file:”=!

call :pthquery

)

if /i not “!file:~-4!”==”.chm” (echo.&echo 该文件类型名不是 .CHM ,按任意键退出&pause>nul&exit)

set save_pth=!file_name: =!

cd /d “!file_pth!”

hh -decompile !save_pth:~0,-4!_CHM !file_name!

start “” “!file_pth!\!save_pth:~0,-4!_CHM”

exit

::提取手工输入路径中的文件夹路径及文件名

:pthquery

set /a pthx+=1

if “!file:~-%pthx%,1!”==”\” (

set file_pth=!file:~0,-%pthx%!

set file_name=!file:~-%pthx%!

set file_name=!file_name:~1!

goto :eof

)

goto :pthquery

声明:本站(华域联盟www.cnhackhy.com)所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。