CHM document unpack batch processing code

Source: Internet
Author: User
Tags unpack

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.