HH's temper is the target folder path is not supported with spaces or quotes, so it becomes more complex, otherwise a line of commands is sufficient.
The rest of the code is not difficult, the emphasis on practical
The batch code is as follows:
Copy Code code as follows:
:: The main command format is as follows
:: Hh-decompile target folder chm source filename
:: Neither the target folder nor the filename can be quoted, and the destination folder cannot contain spaces
@echo Off & setlocal enabledelayedexpansion
Title CHM document Unpack batch 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 Please enter the full path of the CHM file:
echo.&set/p file=
Set File=!file: "=!
Call:p Thquery
)
if/i not "!file:~-4!" = = ". Chm" (Echo.&echo the file type name is not. CHM, press any key to exit &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
:: Extract folder path and filename from manual input path
:p Thquery
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:p Thquery