I understand that this is a common problem but I am unable to decipher the answers and suggestion in other questions to make my specific script work.
@echo on
setlocal EnableDelayedExpansion
set directory=%1
set file_list=%2
for /f "tokens=*" %%i in (%file_list%) DO (
set newName=!%%i:~0,5!
move "%directory%\%%i" "%directory%\!%newName%!s.jpg" )
endlocal
This is giving me this output with echo on
set newName=!image.png:~0,5!
move "\\server\path\to\image.png" "\\server\path\to\!!s.jpg"
So clearly newName is null when I need it, so I can't even begin to troubleshoot the most likely syntax issues when trying to cut it to 5 characters.
THANKS!