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: [Help] Batch File move every 15.000 files to another folders

09 Jul 2014   #11

x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem

Well, I gave up... sort of.

I finished fooling around with batch scripts, but still could not find a clean way to break the loop (a problem with command)

I thought that PowerShell might be a better option and did some research, but did not write anything for you to use. I spent too much time with batch and thought "Hey maybe if I just point SevenDP to PowerShell, he/she might be able to figure it out from there - the OP seems intelligent enough".

Here are some links that might get you started. I don't think PowerShell has the same problem with breaking out of loops that the command shell has.

Windows PowerShell Owner's Manual
Scripting with Windows PowerShell
Windows PowerShell Scripting

Loop examples
ForEach | PowerShell |
powershell - Loop X number of times - Stack Overflow
Hey, Scripting Guy! How Can I Loop Through Collections with Windows PowerShell? - Hey, Scripting Guy! Blog - Site Home - TechNet Blogs

The attached batch file is something you can paly with if you wish, but you'll be better off spending the time on Powershell.

If you don't understand something in the batch file (not well documented) ask and I'll try to explain what I wanted it to do. It's somewhat convoluted in the recursion call and I had to just exit the batch file to break the loop.

Run some tests (it only moves 3 files but there is a variable you can change) I think I left all of the echos on, so the output isn't' pretty.


Attached Files
File Type: bat z_mv15k.bat (2.4 KB, 19 views)
My System SpecsSystem Spec

 [Help] Batch File move every 15.000 files to another folders

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
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...
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
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
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 10:51.
Twitter Facebook Google+