setlocal
rem TCC 23.00.25 x64 Windows 10 [Version 10.0.17134.471]
ver
set CurDir=C:\tmp\cwd
if not isdir %[CurDir] md %[CurDir]
set LogDir=C:\tmp\zip
if not isdir %[LogDir] md %[LogDir]
cdd %[CurDir]
del %[LogDir]\test.zip %[LogDir]\*.txt
echo Test1 >%[LogDir]\Test1.txt
echo Test2 >%[LogDir]\Test2.txt
rem zip /M does not delete the file when
rem 1: The zip file already exists
rem 2: the zip file is not in the current working directory
rem Uncomment this cdd to successfully delete Test2.txt after adding it to the zip file
rem cdd %[LogDir]
zip /m %[LogDir]\test.zip %[LogDir]\Test1.txt
zip /m %[LogDir]\test.zip %[LogDir]\Test2.txt
rem Views Test1.txt and Test2.txt in the zip file
zip /v %[LogDir]\test.zip
rem Lists Test2.txt, it is not deleted (although Test1.txt IS deleted)
dir /fa:-d %[LogDir]
rem TCC 23.00.25 x64 Windows 10 [Version 10.0.17134.471]
ver
set CurDir=C:\tmp\cwd
if not isdir %[CurDir] md %[CurDir]
set LogDir=C:\tmp\zip
if not isdir %[LogDir] md %[LogDir]
cdd %[CurDir]
del %[LogDir]\test.zip %[LogDir]\*.txt
echo Test1 >%[LogDir]\Test1.txt
echo Test2 >%[LogDir]\Test2.txt
rem zip /M does not delete the file when
rem 1: The zip file already exists
rem 2: the zip file is not in the current working directory
rem Uncomment this cdd to successfully delete Test2.txt after adding it to the zip file
rem cdd %[LogDir]
zip /m %[LogDir]\test.zip %[LogDir]\Test1.txt
zip /m %[LogDir]\test.zip %[LogDir]\Test2.txt
rem Views Test1.txt and Test2.txt in the zip file
zip /v %[LogDir]\test.zip
rem Lists Test2.txt, it is not deleted (although Test1.txt IS deleted)
dir /fa:-d %[LogDir]