Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Batch File to Move a list of files.


03 Feb 2012   #1

Windows Server 2008 R2
 
 
Batch File to Move a list of files.

Hey All, I just joined this forum to find some help on a specific topic that I've been researching for like two hours now on google. I have a list of 1300 files that I need to move from one location to another (move not copy). I've found this batch file created by Neutron16 which performs a Move but it's all gibberish to me. How would I modify it to move the files to location "C:\Archive" There's about 4,000 other files in the same folder.

Thanks in advance

My System SpecsSystem Spec
.

03 Feb 2012   #2

Systems 1 and 2: Windows 7 Enterprise x64, Win 8 Developer
 
 

Welcome to SF. That's a copy script. Changed it to a move script. You will need to specify the directory of origin. Also, change extension to "bat"


Attached Files
File Type: txt move_script.txt (87 Bytes, 570 views)
My System SpecsSystem Spec
03 Feb 2012   #3

Windows Server 2008 R2
 
 

Okay, I've researched the move script, this link gave a pretty good tutorial How To Move Files With A Batch File | mixeduperic.com however I need it to pull from a .txt list of all the filenames, I can change how the entries are separated if need be pipe or comma or a list like this:

entry1.xml
entry2.xml
entry3.xml

I'm able to output all of those through excel.

Thanks for your help. And the kind welcome
My System SpecsSystem Spec
.


03 Feb 2012   #4

Win 7 Ultimate (64-bit), Win 8.1.1 (64-bit)
 
 

Here's a batch file that should do what you need:
Code:
@echo off
if %1.==. goto usage
if %2.==. goto usage
if %3.==. goto usage
FOR /F %%i in (%2) do move /Y %1\%%i %3\%%i
goto xit
:usage
echo Usage - muv source_folder file_list.txt target_folder
echo Example - muv c:\tmp data.txt d:\stuff
:xit
Save this into a file called muv.bat

The /Y after the move command says you don't want to be prompted if the move will overwrite an existing file, change to /-Y if you want to be prompted before overwriting.
My System SpecsSystem Spec
Reply

 Batch File to Move a list of files.




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 12:14 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33