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 344479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:59:40+00:00 2026-05-12T10:59:40+00:00

i have an edited version of a config file specific for my machine. i

  • 0

i have an edited version of a config file specific for my machine.
i have the same config file in multiple different directories in my development folder.
i want to, in a single bat file, replace all instances of this file with my edited one.

So in pusedo code:
Take C:\edited.config and copy to C:\Projects\ /s wherever original.config is found

i want the final file to have the name of original.config, not edited.config

so i am guessing i need some combination of a FOR, a rename and copy or something like that

is this easier to do in Powershell?

can anybody help?
Thanks

  • 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-12T10:59:40+00:00Added an answer on May 12, 2026 at 10:59 am

    I blogged about this a little bit ago at http://jamesewelch.com/2008/05/01/how-to-write-a-dos-batch-file-to-loop-through-files/

    I think your solution will look something similar to (below is untested but used to show general idea)

    for /f %%a IN ('dir /b *.config') do copy c:\master.config %%a
    

    There’s probably a switch there on the copy to suppress file overwrite warnings, but I don’t remember what the switch is. This will copy your master.config and overwrite your local file (variable of %%a).

    • 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 different objects that are commonly edited in the same
--edited for clarity (hopefully) I have an XML file that looks something like this:
I just edited an .SWF file I have on my website home page for
I have an array with lots of items with same names like CloudObserverCMSStub edited
/edited/ I'm new here. I have a text file that reads: 6 <cr> R
Edited to add: Drat it! I didn't have the latest version of the code.
EDIT: I have edited my post... Working on a project (c#), I have a
NOTE: EDITED The real-world situation is a series of events that each have two
I have a pop up with plenty of options which can be edited -
I edited the question so it would make more sense. I have a function

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.