Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has 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.

 
02-03-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

Attached Files
File Type: zip ZZZZ_script.zip (503 Bytes, 10 views)
My System SpecsSystem Spec
02-03-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, 79 views)
My System SpecsSystem Spec
02-03-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
.


02-03-2012   #4


Win 7 Home Premium (64-bit), Win 7 Pro (32-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. problems?



Thread Tools



Similar Threads for: Batch File to Move a list of files.
Thread Forum
Batch code to read, then move files from one folder to another General Discussion
Batch file to move (many) duplicted folder contents - Help!! General Discussion
How to create a batch file that will move files based on the file type General Discussion
Batch file for moving files to folder? General Discussion
Open Multiple Files one click - simple bat/batch file General Discussion


All times are GMT -5. The time now is 02:21 AM.



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
  

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