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

Is there a way in Windows to find and replace all files?

Could PowerShell do this?

I have a .dll file that I have a bunch of and would like to update them all with one click.

EDIT: I would like to be able to replace file1.dll with another file1.dll and rename the old one to file1.dll.original

share|improve this question
2  
It would be a lot easier to help you if made your objectives more clear and included a more verbose description. As it stands now this question doesn't make a lot of sense. To answer what you have made somewhat clear, yes, Powershell can find and replace files – Darian Everett Aug 14 '13 at 16:01
1  
If you have enough copies of the same DLL that you need to do a search and replace on them then you are doing it wrong. After the second or third copy you should have moved it to a common location and pointed the programs at that single copy. – Mokubai Aug 14 '13 at 17:52

From what I think you're trying to do, this should solve your problem (using Powershell)

$oldLocation = "C:\users\user\FilesToBeCopied"
$newLocation = "C:\users\user\FilesThatNeedToBeOriginal"
cd $newLocation
dir | % {  $name = $_.Name + ".original"; ren $_ $name; }
copy $oldLocation\* $newLocation
share|improve this answer
    
This is your answer please be sure to give him credit! – Matt Case Aug 14 '13 at 19:01

reserv.cmd:

SET in=I:\work directory
SET out=I:\source directory
SET cmSet=for /f "delims=" %%A in ('dir /B

%cmSet% "%in%\*.dll"') do ren "%in%\%%A" "%%~A.original"
%cmSet% "%out%\*.dll"') do xcopy /I /S /E /H /Q /-Y /Z "%out%\%%A" "%in%\"
share|improve this answer

You must log in to answer this question.

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