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
Slartybart

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 | SS64.com
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.

Bill
.




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

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




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
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
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
a simple batch file for copy files and folders
I want to write a batch file that do this for me: - makes a directory with the "yy.mm.dd.hh.mm" as the directory name, - copies files and folders from a TEST directory to above destination, - copies only new (or modified) files from the TEST directory to a separate folder. Any Idea?
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 23:17.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App