1. Create a .bat file inside the log folder location
2. Edit that bat file and copy the below contents and save.
@echo
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set "fullstamp=%MM%-%DD%-%YYYY%_%HH%-%Min%-%Sec%"
echo compressed file to zip that folder
set path=%cd%
:: uncomment the below line enter the path if the bat file is in different location
rem set path=
cd %path%
zip -r compressed_%fullstamp%.zip *.* -x "*.zip" "*.bat"
3. If we execute the bat file, all the files inside the folder will be compressed.
Comments
0 comments
Article is closed for comments.