Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Script to sequentially move 5,000 files at a time?

I created 1 million files that I'm trying to upload to a device. However, file explorer crashes if I select too many at once. I'm trying to break them up and move them into subfolders in batches of 5000.

The naming scheme for the files are snowfile1.txt - snowfile1000000.txt

The naming scheme for the folders are snow1 - snow200

What script can I use to move files 1-5000 into folder 1, then repeat or for loop for the next 199 folders in sequence?

Thanks in advance for all the help!


EDIT: I figured it out! Thanks for recommending I use robocopy & encouraging me to figure it out my self. I actually learned something new!

Solution:

for ($i = 10; $i -lt 15; $i++) {
    ROBOCOPY (source) (destination) (file)$i.txt /MOV
}

Didn't get around to figuring out how to script it to do it for all my folders at once, but I'm getting close.

Thanks again!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!