====== Search and Replace in All Files ======
===== Command Line =====
Current directory:
for /r . %x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%x"
Specified directory (untested):
for /r "C:\Temp" %x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%x"
===== From a Batch File =====
Current directory:
for /r . %%x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%%x"
Specified directory (untested):
for /r "C:\Temp" %%x in (*.csproj) do perl -pi -i.bak -e "s/searchterm/replaceterm/" "%%x"
===== Switch Off Code Analysis =====
Current directory:
for /r . %x in (*.csproj) do perl -pi -i.bak -e "s/true<\/RunCodeAnalysis>/false<\/RunCodeAnalysis>/" "%x"
Specified directory (untested):
for /r "C:\Temp" %x in (*.csproj) do perl -pi -i.bak -e "s/true<\/RunCodeAnalysis>/false<\/RunCodeAnalysis>/" "%x"
{{tag>code_snippet search replace code_analysis perl}}