| 1234567891011121314151617181920212223242526272829 |
- @echo off
- REM Check whether parameters are provided.
- if "%~1"=="" (
- echo err: Please specify the path of the compressed package to extract.
- exit /b 1
- )
- REM Get the compressed package path
- set "archive_path=%~1"
- REM Check whether the compressed package exists.
- if not exist "%archive_path%" (
- echo Error: The compressed package does not exist - %archive_path%
- exit /b 1
- )
- REM Extract to the current directory using tar.
- echo Decompressing:%archive_path%
- tar -xzvf "%archive_path%" -C .
- REM Check whether it is successful.
- if errorlevel 1 (
- echo Error: Decompression failed.
- exit /b 1
- ) else (
- echo Decompression succeeded! The content has been extracted to the current directory.
- )
- exit /b 0
|