我正在制作一个程序,将特定文件解压缩到一个没有添加程序/添加的文件夹
当前代码:
@echo off
for /f "tokens=2*" %%a in ('REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0" /v
AppPath') do set "AppPath=%%~b"
echo Installing to: %AppPath%
XCOPY "%~dp0include\HONDA_JET" "%AppPath%SimObjects\Airplanes\HondaJet" /C /S /Y /I
pause
我不能使用除批处理以外的任何文件,所以没有vbs。
感谢
PS 请关闭此主题,如果它在另一个主题中并给我链接
答案 0 :(得分:1)
在没有第三方工具示例的情况下解压缩文件:
@set @e=0 /*
@echo off
set @e=
setlocal
set "i=0"
for %%i in (%*) do set /a "i+=1"
if "%i%" neq "2" goto:eof
cscript //nologo //e:jscript "%~f0" %1 %2
endlocal
exit /b
*/
function Extract(zip, dest) {
with (new ActiveXObject('Scripting.FileSystemObject')) {
if (!FolderExists(dest)) CreateFolder(dest);
with (new ActiveXObject('Shell.Application')) {
NameSpace(GetFolder(dest).Path).CopyHere(Namespace(GetFile(zip).Path).Items());
}
}
}
with (WScript.Arguments) {
try {
var zip = Unnamed(0), dest = Unnamed(1);
Extract(zip, dest);
}
catch (e) {
WScript.echo(e.message);
}
}
用法:
unzip.cmd myarc.zip foo