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
OvrKLL

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
Lemur

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, 735 views)
My System SpecsSystem Spec
03 Feb 2012   #3
OvrKLL

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
strollin

W10 Pro desktop, W10 laptop, W10 laptop, W10 Pro tablet (all 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
27 Aug 2015   #5
jcg41041

Windows 7 Ultimate x64
 
 

I can't seem to get this batch to work could you. Any additional information I might be missing?
My System SpecsSystem Spec
27 Aug 2015   #6
Ztruker

Windows 10 Pro X64
 
 

Remove the echo off at the top then run it and post the error output here.
My System SpecsSystem Spec
Reply

 Batch File to Move a list of files.




Thread Tools




Similar help and support threads
Thread Forum
Help batch file to move files in list to created subdirectory
Please excuse me in advance because I am not very experienced making batch files. I'm not asking for a free lunch and would gladly paypal someone some cash for a working batch file. I have a parent folder that contains several subfolders. Each subfolder has several files in them. I need a batch...
General Discussion
Move files from original folder to existing folders - w batch file?
My files have a format of "ID_date_time.d7d Ex: 11111-5_2013_10_07_142149.d7d The ID is 1111-5 and was tested 10/7/2013 at 2:21:49 PM and the file extension is always .d7d The local files are automatically saved here by the program generating the data: C:\Local\Data I want them copied...
General Discussion
[Help] Batch File move every 15.000 files to another folders
Hi guys I'm new here, please help I have about 2 million email files that i want to convert into mbox files. but the tool i used only can convert every 15.000 files. so i need a batch file that can move this 2 million files into another folder (15.000 files each folder) and the folder name...
General Discussion
Batch File - List files modified within last 7 days
Hi All, I'm trying to create a batch file that will create a text file listing all the files within a folder that has been modified within the last 7 days, i thought this was going to be easy using some kind of switch that looks at the modified date but that doesn't seem to exist and i can't...
General Discussion
How to create a batch file that will move files based on the file type
How to create a batch file that will move files based on the file type? My Requirement : I need a batch file to copy all .doc files in all my HardDisk to a removable disk say (Z: drive) . Can anyone make it possible using a batch file?Please...Its urgent...
General Discussion


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 16:40.
Twitter Facebook Google+