07-23-2023, 10:17 AM
Using this batch file I want zip some *.txt files. Each *.txt file in its own zip file. Unfortunately it is not working and i get as output
ECHO is disabled (OFF).
several times. Here is the sourcecode:
@echo off
setlocal EnableDelayedExpansion
for %%i in (*.txt) do (
set filename = %%i
set filenametrunc = %filename:~0,10%
7z a -tzip -mx0 %zipname%
echo %filename% zipped.
)
I read something about EnableDelayedExpansion and activated it. Can't get it working though.
Any help appreciated.
ECHO is disabled (OFF).
several times. Here is the sourcecode:
@echo off
setlocal EnableDelayedExpansion
for %%i in (*.txt) do (
set filename = %%i
set filenametrunc = %filename:~0,10%
7z a -tzip -mx0 %zipname%
echo %filename% zipped.
)
I read something about EnableDelayedExpansion and activated it. Can't get it working though.
Any help appreciated.