Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 238615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:31:10+00:00 2026-05-11T20:31:10+00:00

Anyone know of a command line utility (or one that can run as a

  • 0

Anyone know of a command line utility (or one that can run as a command line) that will collect all the .jpg files in a directory tree to a single folder, only copying files that change?

I started with Renamer, which is great for renaming files in their current directories, but fell short when I tried to mangle the path. This is probably because I don’t know Renamer that well. I ended up creating a text file directory dump, then using a REGEX find / replace to create a batch file, but this is hardly efficient nor automated.

The REGEX:

(G:\DIR\DIR\)([0-9]+\)([0-9]+\)([0-9]+\)([0-9]+\)(p[0-9]+.jpg)

changed this

G:\DIR\DIR\00\00\00\00\p0000000000.jpg

to this

G:\DIR\DIR\p0000000000.jpg

(copy \1\2\3\4\5\6 \1\6) in the batch file.

I need to run the whole thing as a scheduled task without a real person logging in. Not really looking for a Zip file because I don’t want to disturb the system processor, plus most of the files will not change from day to day. This is more of a file sync.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:31:11+00:00Added an answer on May 11, 2026 at 8:31 pm

    In a Windows command line you can do this:

    for /R A %i IN (*.jpg) DO xcopy %i B /M /Y
    

    Where A is the source directory and B is the destination directory. You need to have command extensions enabled, which I believe is the default.

    A couple of notes from the comments:

    If any of your paths could have spaces in you will need to add quotes around the second %i. This prevents the string being interpreted by the xcopy command as two separate parameters. You may need to do the same around A and B paths. Like this:

    for /R "A" %%i IN (*.jpg) DO xcopy "%%i" "B" /M /Y
    

    If you are putting this inside a .bat or .cmd file you will need to double the percentage like this.

    for /R A %%i IN (*.jpg) DO xcopy %%i B /M /Y
    

    The /M option on xcopy will only copy files with the Archive bit set and then unset this bit. This prevents the files being copied twice. If you have other processes that also alter this bit it may cause issues. It is also possible to use the /D option which compares the file’s last modified time with that in the destination and only copies newer files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

does anyone know how to enable Ctrl-o to switch to normal-mode for one command
I'd like to make a GUI that will take in a file directory and
Does anyone know if there is a reader (text-to-speech) tool for cygwin or linux?
I recently started using WPF and the MVVM framework, one thing that I have
I'm running a small minecraft server with this command: /usr/lib/jvm/java-6-sun/bin/java -Xmx2048M -Xms2048M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing
I'm trying to use sqlcmd on a windows machine running SQL Server 2005 to
I've been trying to get into C++ programming with Eclipse, but I'm having problems
Here's the context of the question: In order for me to be able to
I have written a .NET Windows service which has a WCF service built into
I'm trying to start an external process via Java using the ProcessBuilder class, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.