I have a script that downloads files from an s3 bucket and I want to log the time it takes. So I have a for loop that goes through each s3 file and then if the size is greater that a set value I download the file. From within the if statement I echo out a line that includes the name of the file and the time. The problem is the time value does not change. I have created a very simple example that shows the issue.
@echo off
setlocal enabledelayedexpansion
set CUR_YYYY=%date:~10,4%
set CUR_MM=%date:~4,2%
set CUR_DD=%date:~7,2%
set SUBFILENAME=%CUR_YYYY%%CUR_MM%%CUR_DD%
cd C:\Users\Public\code
echo %time% %date%> Outside_IF_%SUBFILENAME%.log
timeout /t 10
echo %time% %date%>> Outside_IF_%SUBFILENAME%.log
timeout /t 10
echo %time% %date% - Welcome Here>> Outside_IF_%SUBFILENAME%.log
timeout /t 10
echo %time% %date% - Welcome Here Again>> Outside_IF_%SUBFILENAME%.log
if not exist "1.txt" (
echo %time% %date%> Inside_IF_%SUBFILENAME%.log
timeout /t 10
echo %time% %date%>> Inside_IF_%SUBFILENAME%.log
timeout /t 10
echo %time% %date% - Welcome Here>> Inside_IF_%SUBFILENAME%.log
timeout /t 10
echo %time% %date% - Welcome Here Again>> Inside_IF_%SUBFILENAME%.log
)
So how do I get the Outside_IF to work in Inside_IF
Any help will be greatly appreciated