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

  • SEARCH
  • Home
  • 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 3791648
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:30:06+00:00 2026-05-19T12:30:06+00:00

I have a directory with a bunch of subdirectories. MAIN_DIR\ Each sub-dir is a

  • 0

I have a directory with a bunch of subdirectories.

MAIN_DIR\

Each sub-dir is a “project name”, e.g.

MAIN_DIR\BOBEVANS324

MAIN_DIR\BILLJOHNSON3

Each “project” folder contains a bunch of sub-dirs in it. Let’s say I was looking for “.abc” files that all have names that make no sense without looking at the folder structure. For example,

MAIN_DIR\BOBEVANS234\SUBDIR\3904902490.abc

As you can see “3904902490.abc” doesn’t make any sense outside the context of the directory tree. I’d want to rename it by appending the directory names to the filename after copying the file.

So, it would look through ALL subfolders of MAIN_DIR and try to find “.abc” files. When it finds one, it copies it over to a dest directory and renames it something like “BOBEVANS234_SUBDIR_3904902490.abc”.

  • 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-19T12:30:07+00:00Added an answer on May 19, 2026 at 12:30 pm

    You want to look at the FileSystemObject, especially the Folder Object and it’s SubFolders and Name (to create the new names) properties and the File Object and it’s Move Method (remember, if you move a file to a different name in the same directory, it will have the same effect as a rename).

    To find the files to rename, you’ll have to look for them by hand unfortunately, though it is reasonably easy as can be seen in this MS KB article (it’s written for VB6 but that’s very similar to VBScript): HOW TO: Recursively Search Directories by Using FileSystemObject

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

Sidebar

Related Questions

I have a bunch of directories, in each directory I have bunch of sub
I have a directory and a bunch of sub-directories like this: - directory1 (
I have a bunch of files in a directory, each with one line of
I have a bunch of models in a sub-directory that inherit from a model
I have a directory with a name that contains Japanese characters, and I need
So I have a directory of with a bunch of sub-directories that contain .java
I have bunch of groovy scripts in various directories (not necessarily netbeans/maven project dirs).
files = Dir[File.join(path, '**', '*.jpg')].each do |s| puts s end I have a bunch
I have a git directory which contains the a whole bunch of files and
Suppose I have a directory on Linux with a bunch of files and subdirectories.

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.