Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.


share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

1 Answer 1

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 or ask your own question.