Thank you both! Unfortunately, the variable is still blank. I thought maybe if I sent the results that might help.
Here is the updated code:
Code: Select all
@SETLOCAL ENABLEDELAYEDEXPANSION
cls
set themes=CDTNEW,CFTNEW
for %%z in (%themes%) do (
set "Now=C:\Users\psnider\Documents\Stuff\MISCELLANEOUS\ArchiveAurora\Files_Helper\%%~z_Now.csv"
for %%a in (!Now!) do (
set myfiledateNow=%%~ta
)
)
Here are the results:
C:\Files_Helper>set themes=CDTNEW,CFTNEW
C:\Files_Helper>for %z in (CDTNEW C
FTNEW) do (
set "Now= C:\Files_Helper\Files_Help
er\%~z_Now.csv"
for %a in (!Now!) do (set myfiledateNow=%~ta )
)
C:\Files_Helper>(
set "Now= C:\Files_Helper\Files_Help
er\CDTNEW_Now.csv"
for %a in (!Now!) do (set myfiledateNow=%~ta )
)
C:\Files_Helper>(set myfiledateNow=
)
C:\Files_Helper>(
set "Now= C:\Files_Helper\Files_Help
er\CFTNEW_Now.csv"
for %a in (!Now!) do (set myfiledateNow=%~ta )
)
C:\Files_Helper>(set myfiledateNow=
)
C:\Files_Helper>
I think that some of the parens would have been on the same line, but the file path I used was much longer and I replaced it for the purposes of this post.
Than you!