You are not logged in.
Pages: 1
Hi,
I have a .txt with a list of name files:
111.jpg
222.jpg
333.jpg
etc. ...
I need a script that check if each of these files exist in a given folder, eg move file source c : \ -to- destination \\server\files files \. Is this possible?
Thanks,
srinivas
Offline
It's not clear from your description if you want to move files that "do" or "don't" exist at target. I've assumed "don't" (just remove the "NOT" if that's the wrong assumption).
@echo off
for /f "usebackq tokens=*" %%a in ("list.txt") do if NOT exist "\\server\files files\%%~nxa" move /y "%%~fa" "\\server\files files\%%~nxa"
cmd | *sh | ruby | chef
Offline
You can just use the command
'If not exist <filename>.<file extension> <command>'
Or
'If exist <filename>.<file extension> <command>'
Offline
Pages: 1