Server Fault is a question and answer site for system and network administrators. 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

For Linux, sed and find are an easy option to search and replace in many files including subdirectories. Is there a way to do the same in Windows (with or without PowerShell)?

share|improve this question
up vote 3 down vote accepted

While PowerShell is certainly capable of this, have you considered using the UnxUtils Win32 ports?

share|improve this answer

Many text editors/programming IDEs include advanced Find/Replace functionality that will do exactly what you're looking for. A couple that I have used and have been pleased with include Notepad++ and Visual Studio

share|improve this answer
I love Notepad++ however for this task I need a scripting utility – mjn May 10 '10 at 19:02

When I needed it, I used Windows Grep application that not only searches, but replaces as well

share|improve this answer

My favourite utility is fart.exe. (Find And Replace Text.exe)

Here is a link

Gotta love the logo...

share|improve this answer

My fav for this purpose is SFK (Swiss File Knife).

I've employed it for finding injected code patterns in files on web servers searching from the drive root all the way through the subdirectories.

Works great.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.