You are not logged in.

#1 06 Aug 2014 07:34

srinivas.u
New Member
Registered: 04 Aug 2014
Posts: 1

with a list of name files

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

#2 11 Aug 2014 10:51

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,129

Re: with a list of name files

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

#3 21 Aug 2014 06:40

Mortharklem
Doghouse
Registered: 20 Aug 2014
Posts: 4

Re: with a list of name files

You can just use the command

'If not exist <filename>.<file extension> <command>'

Or

'If exist <filename>.<file extension> <command>'

Offline

Board footer

Powered by