CHM 文檔解包批處理代碼

來源:互聯網
上載者:User

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.