Windows 10不能从bat文件中以cmd格式解压缩

问题描述 投票:0回答:1

[我试图编写一个.bat文件以提取内容并将其放入当前目录,但是当我在.bat文件中使用unzip时,会看到以下错误。

'unzip' is not recognized as an internal or external command, operable program or batch file.

但是当我从cmd提示符下执行它时,相同的解压缩仍在工作。您能否让我知道如何解决此问题。

这里是代码

SET path=%1
echo %path%
unzip -o %path%
echo 'Overwrite completed, now updating the files with the new changes...'
batch-file windows-10 unzip
1个回答
0
投票

[unzip不是本机批处理文件命令,并且更改环境变量,例如path是不当行为,因此您必须使用此:

set path_="%~1"
echo %path_%
Full path of unzip\unzip.exe -o "%path_%"
echo Overwrite complete, updating files with new changes...
© www.soinside.com 2019 - 2024. All rights reserved.