we have a repository with files and folders. The folders are named like the files with the only difference that the seperator of the file extension (normally a dot “.”) is replaced through a comma “,”.
For example: Filename: “Test.txt” Foldername: “Test,txt”
Now I want to run a loop, to check if there are folders where the related file has been deleted.
Then I want to move these folders into a newFolder.
The code I tried is:
for /d %i in (*) do (set dat=%i && set dat=%dat:,=.% && if not exist "C:docs%dat%" move /y %i "C:docsNewFolder")
My problem is that the set commands are only executed in the first loop and the replacement function seems not to work accurate.
Thanks in advance.
iggy2556 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.