Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:24
Show Gist options
  • Save ezhov-da/afc66b08749236626f2e3666fbe2e47b to your computer and use it in GitHub Desktop.
Save ezhov-da/afc66b08749236626f2e3666fbe2e47b to your computer and use it in GitHub Desktop.
bat created
@echo off
chcp 855
rem SET VARIABLES========================================================================
if "%~1" == "" goto no_param
if "%~2" == "" goto no_param
if "%~3" == "" goto no_param
SET ZIP_FOLDER=%~1\*
SET ZIP_ARCHIVE=%~2
SET FILE_BASE_64=%~3
echo Set variables:
echo ZIP_FOLDER: %ZIP_FOLDER%
echo ZIP_ARCHIVE: %ZIP_ARCHIVE%
echo FILE_BASE_64: %FILE_BASE_64%
rem SET ZIP_FOLDER=E:\_git_local_data_\trunk\java\tree-paragraph-creator\*
rem SET ZIP_ARCHIVE=E:\base-64-ecode\tree-paragraph-creator.zip
rem SET FILE_BASE_64=E:\base-64-ecode\tree-paragraph-creator.txt
rem =====================================================================================
rem 7Z
SET SEVEN_ZIP_EXE=C:\"Program Files"\7-Zip\7z
echo %SEVEN_ZIP_EXE%
SET SEVEN_ZIP_EXE_COMMANDS=a
SET CMD_TEXT=%SEVEN_ZIP_EXE% %SEVEN_ZIP_EXE_COMMANDS% %ZIP_ARCHIVE% %ZIP_FOLDER%
%CMD_TEXT%
rem CONVERT TO BASE 64
SET GROOVY_BAT=E:\java_library\groovy-2.4.12\bin\groovy.bat
SET GROOVY_SCRIPT=E:\_git_local_data_\trunk\java\groovy-scripts\src\main\groovy\ru\ezhov\groovy\Base64Converter.groovy
SET COMMAND=-f
SET FROM_ZIP=%ZIP_ARCHIVE%
%GROOVY_BAT% %GROOVY_SCRIPT% %COMMAND% %FROM_ZIP% %FILE_BASE_64%
goto exit
:no_param
echo Use [folder zip] [zip archive file create] [base 64 file create] args
:exit
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment