CHM Document unpack Batch code _dos/bat

Source: Internet
Author: User
Tags goto unpack
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

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.