I am attempting to find the most recent files in a network folder using a wild card. The code within the batch file is provided below. When the .bat file is executed it returns an error
for /f %%f in ('dir /b /s "\\winp-xxx-123\mcr_star112_stsaxg\MDCR\FEMUR.*ohl*"') do (
set fileDateTime=%%~tf
set fileName=%%~nxf
echo !fileDateTime!
echo !fileName!
)
RunTime ERROR: The network name cannot be found.
Any assistance on what i am doing incorrectly?
Thank you in advance for your help. :)
JavaGirl
NET USE
command. I had to add this line at the start of the scriptsetlocal enabledelayedexpansion
because of the !variables! in the loop. It worked fine. I assume the path actually exists (e.g. thatDIR
works?)