The program exits without warning as soon as it hits the second FOR loop FOR /F %inputDir% %%F in (*.jpg) do
I am running on a windows 10 machine, moving and renaming pictures
I have already tried putting in break points and flags, but to no avail. I even tried just having a dummy load (just an echo and then pause) inside the FOR loop (FL) since I learned from somewhere that batch executes entire FLs at once. I have NOT tried using delayed expansion, but willing to learn how.
@echo off
echo LOADING CONFIG
cd "Batch stuff"
FOR /F "tokens=1,2 delims=&" %%A in (config.txt) do (
REM echo %%A
REM echo %%B
SET inputDir=%%A
SET outputDir=%%B
)
echo inputDirectory: %inputDir%
echo outputDirectory: %outputDir%
echo CONFIG LOADED
echo Continue?
pause
FOR /F %inputDir% %%F in (*.jpg) do (
echo here
pause
cls
echo openning: %%F
echo newName:
SET /P newName=Enter a new name for this image:
cls
echo openning: %%F
echo newName: %newName%
echo Hit space to continue or exit the program (manually)
pause
REM CALL nameAndMove %%F %newName%
)
Expected results: Second FL runs opens the picture Prompts for newName clears Screen re-displays information (filepath and newName) and asks for confirmation calls to a WIP subroutine (FL didn't work even when I wasn't calling to the sub)
I am not able to see any error messages since the program exits before I get a chance to see any. Even with the pause function after the second FOR loop, I am still unable to get the program to freeze. I assume this has something to do with incorrect syntax, since the FL failed with a dummy load.
Filepath:
