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, 606 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

W7 Ult desktop, W8.1 laptop, W7 Home netbook, W8.1 tablet, Win 10 TP VM
 
 

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





Similar help and support threads
Thread Forum
Batch file to Sort and Move specific files by identifying word inside
Hi All... I will explain what I need in as much detail as possible. I need a batch file to move specific files into a separate folder,possibly by opening my hex editor,searching for the word "body" ( without the quotes ) and if found ,close hex editor,move file to a folder called "moved" ,then go...
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
Batch file to move desktop icons so ALL are sorted.
Win7 stores desktop icons in two different folders: C:\Users\Public\Public Desktop C:\Users\UserName\Desktop This results in two groups of sorted icons on the desktop. I want to move all of the icons in the "C:\Users\Public\Public Desktop" to the "C:\Users\UserName\Desktop". This will...
General Discussion
Batch file to move (many) duplicted folder contents - Help!!
Hope I can explain my difficulty. I have duplicated folders album name for all my music files. As there is quite a considerable number I wondered if it was possible to batch file (automate) the process. I can not delete "d" as this would delete all the tracks. What I need to do is move the...
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 12:32.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App