DOS command to replace all instances of .config?

I blogged about this a little bit ago at jamesewelch.com/2008/05/01/how-to-write-... 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).

I blogged about this a little bit ago at jamesewelch.com/2008/05/01/how-to-write-... 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).

The /y option suppresses prompts – shufler Aug 26 '09 at 23:19.

I'm amazed what DOS batch file experts make work. Since I'm not one of them, I take an approach that's pragmatic for me. It might work for you as well.

Get a list of destination folders C: Cd\ Dir original. Config /s > original. Bat Edit original.

Bat in your favorite text editor (I like Notepad++) Search for "original. Config" and replace with "" (empty string) Insert the text "Xcopy C:\edited. Config " at the front of each line Proof-read the result to be sure it's what you want.

If you're not sure put an "Echo " in front of each line for a dry run. Run the batch file.

Yeah some of the wizardry these guys come up with is amazing. – ryancrawcour Aug 27 '09 at 0:19.

Echo off C: cd \Projects FOR /F "tokens=*" %%G IN ('DIR /B /S original. Config') DO xcopy /y c:\edited. Config %%G.

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.

Config and copy to C:\Projects\ /s wherever original. I want the final file to have the name of original. Config, not edited.

Is this easier to do in Powershell? Can anybody help?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions