-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzip2bat.bat
More file actions
31 lines (31 loc) · 806 Bytes
/
zip2bat.bat
File metadata and controls
31 lines (31 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@echo off
set ext=%~x1
set fn=%~n1
IF NOT %ext%==.zip (
echo I want the zip file.
echo press any key to exit...
pause > NUL
exit
)
set out_bat="extract_%fn%.bat"
set out_b64="base64_%fn%"
( echo @echo off
echo cd /d %%~dp0
echo set fn=%%~n0
echo if exist %%fn:extract_=%% ^(
echo echo A decompressed folder exists.
echo pause
echo exit
echo ^)
echo set fileName="%%fn:extract_=%%_tmp.zip"
echo certutil -decode "%%~f0" %%fileName%%
echo call powershell -command "Expand-Archive ""%%fileName%%"" ""%%fileName:_tmp.zip=%%"""
echo del %%fileName%%
echo echo extraction process has completed.
echo echo press any key to exit...
echo timeout /t 5 ^> nul
echo exit /b %%errorlevel%%
) > %out_bat%
certutil -encode "%~1" %out_b64%
copy /b %out_bat% + %out_b64%
del %out_b64%