HH's temper is that the destination folder path does not support spaces or quotation marks, so it becomes complicated. Otherwise, a line of command is enough.
Other Code No difficulty, focusing on Practicality
The batch processing code is as follows: Copy code The Code is as follows:
: Name of the CHM source file in the HH-decompile target folder
: The target folder and file name cannot be enclosed by quotation marks. The target folder cannot contain spaces.
@ Echo off & setlocal enabledelayedexpansion
Title CHM document unpack batch processing by suntb
If exist "% ~ Dpnx1 "(
Set file = % ~ Dpnx1
Set file_pth = % ~ Dp1
Set file_pth =! File_pth :~ 0,-1!
Set file_name = % ~ Nx1
) Else (
For Echo. & Echo, enter the full CHM File Path:
Echo. & set/P file =
Set file =! File: "=!
Call: pthquery
)
If/I not "! File :~ -4! "=". Chm "(echo. & echo this 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 the folder path and file name from the manually entered path
: 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