Moving Files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
frostedflakes
Posts: 9
Joined: 06 Dec 2014 16:37

Moving Files

#1 Post by frostedflakes » 01 Mar 2015 20:49

I need to create a batch program to move files that do not have same files names in other formats. let me explain

I have folders with 15,000+ file in them. I want to move some files that don't match other types, ie. filename.mp4 filename.txt filename.jpg, filename2.mp4, filename3.mp3 filename3.txt filename3.jpg.

i wan t be able to move filename2.mp4 to a seperate folder. All i can do is move fiels based on a list. that's as far as i can get witha batch script. Here os what i have..

@echo off
SET Filelist=D:\Dropbox\filelist.txt
SET src_folder=D:\source
SET tar_folder=D:\target

for /f "delims=" %%a in (' type "%Filelist%" ') do ( move "%src_folder%\%%a" "%tar_folder%\" )

pause


any help is appreciated

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Moving Files

#2 Post by Squashman » 01 Mar 2015 21:13

So are you saying you only want to move files that only have one common file name?
If they do not have another file with a different extension then move it?

frostedflakes
Posts: 9
Joined: 06 Dec 2014 16:37

Re: Moving Files

#3 Post by frostedflakes » 01 Mar 2015 21:58

yes, 1 common name. If no other filename with different extension move it.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Moving Files

#4 Post by foxidrive » 02 Mar 2015 07:18

You mention plural of folders and huge numbers of files, and we have no information about which parts of the system needs searching and the criterion of where these files are likely to be.

See here: viewtopic.php?f=3&t=6108

Post Reply