I’m looking to write a script that will load up a file that has a bunch of directory/filenames in CSV format, and then output what files are not found.
This is what I have so far:
for /f "delims=, tokens=1,2,3" %i in (C:\foo.csv) do dir "Y:\%i\%j\%k" >> C:\temp\log.txt
Which outputs everything.
What I really want is for it to log nothing if it is found, and then just a single line error of something similar to:
File AC\0d\234csf-234wfv-423vx-23fsdfs.jpg was not found
But right now it logs everything.
How can I achieve this?
You seem to use the command interactively so here’s a solution to be used directly in the console:
A more readable multi-line version (to be used in a batch script, obviously, hence
%%instead of%):