Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I have the below task and I am wondering what would be the best and quick way to do this. I am thinking scripting rather than a C# app but struggling with scripting in DOS. I wanted to use powershell but not sure if all the machines have powershell installed :

I have around 15 windows machines and in each machine, I want to find all *.config files (in say C:\ and D:) and replace a specific word (db name).

I can execute this locally or execute this remotely, since I have login access to the machines. But the tough part is the script.

Any pointers would be great to start.

Thanks.

share|improve this question

marked as duplicate by Karan, AthomSfere, soandos, tombull89, Excellll Jun 24 '13 at 14:17

This question was marked as an exact duplicate of an existing question.

1  
Does it have to be a script? Otherwise there are portable apps that can do this easily, or even command-line search/replace utils. See for example superuser.com/questions/593509, superuser.com/questions/87544, superuser.com/questions/199818, superuser.com/questions/394526, superuser.com/questions/564623 and many more. – Karan Jun 13 '13 at 16:17
    
yes, script was not really useful. Thanks for the utility idea, used grep win. – Mani Jun 14 '13 at 9:37
up vote 0 down vote accepted

I would use a tool like grepWin for this.

grepWin site

You should be able to give it the string to search for, then the string to replace with, along with the location to search. Should be easy as can be.

share|improve this answer
    
Thanks, yes, grepwin was helpful and I used the same. – Mani Jun 14 '13 at 9:36

Not the answer you're looking for? Browse other questions tagged .