Cti Posted September 4, 2007 Share Posted September 4, 2007 (edited) I just cannot rap my head around this. I just want replacer to switch a file, I am going to run it from cmdlines.the readme says To execute the script, drag and drop it onto the Replacer.cmd file. Or, run Replacer from the command line with the script as a parameter. Sample script:;; ReplacerScript; Replace and restore notepad notepad.exe,notepad.new notepad.exe,Restore; Optionally replace Commdlg commdlg.dll,new.dll,1,Optionalreplacer.cmd /? shows this Replaces protected system files. Usage: Replacer "ScriptFile" Example: Replacer "C:\Replacer\Script.txt" Script syntax:;; ReplacerScript; Comment SystemFileName [,ReplacementFile] [,Reference#] [,Optional] Script example:;; ReplacerScript; Replace Notepad, Calc, Paint notepad.exe,notepad.new calc.exe,files\calc.new mspaint.exe,"C:\Files\paint.new"; Prompt to optionally restore Notepad from backup notepad.exe,RESTORE,Optional See readme.txt for ReferenceNumber details.I have tried so many different things and I cannot seem to get this 1. Where do you put the new file ?2. Can someone write me an example 3. Also exactly what file to execute from cmdlines 4. In the simplest of terms thanks Thank youEDIT: alright I got it work work, but I ran into another snag. I am just experimenting, easy enough to run a replacer.cmd script.txt script.txt ;; ReplacerScript; Replacer "filename here""old file here","new file here"without the " "now it runs fine but it it says 1 file will be replaced. Press any key to start the scriptI want it to be fully unattended ??thanks Edited September 4, 2007 by Cti Link to comment Share on other sites More sharing options...
mushu13 Posted September 4, 2007 Share Posted September 4, 2007 Why not just replace the file directly on the nLite disk? Link to comment Share on other sites More sharing options...
Cti Posted September 4, 2007 Author Share Posted September 4, 2007 Why not just replace the file directly on the nLite disk?Well I am installing a icon pack and one of the files are messed up, so I would like to replace with my own pack once installedplease explain any idea's you might have.using replacer seems like a pretty easy way, I just need to figure out that one issue.Thanks Link to comment Share on other sites More sharing options...
jaclaz Posted September 5, 2007 Share Posted September 5, 2007 Well, though very complex, Replacer.cmd is just a batch file, you can easily modify it to suite your needs.The two messages you are having should come from Special.cmd.In the downloaded zip there is a "data" file.Open it with 7zip, inside it there are three files:Clear_WFP_Message.vbsSpecial.cmdZap.exeOpen with notepad special.cmd and you should find the two messages.:\RepScr echo/%%3 file(s) will be replaced. exit/b:\KeyScr echo/Press any key to start the script. exit/bYou can simply delete the lines starting with echo to get rid of the two messages.Now open Replacer.cmd and search in it for "KeyScr", you should find this:call:say Message KeyScr pause>nul&clschange this:pause>nul&clsto:clsto get rid of the PAUSE command (i.e. of the need to press a key to continue program execution)jaclaz Link to comment Share on other sites More sharing options...
Cti Posted September 6, 2007 Author Share Posted September 6, 2007 Thank you for this, I will give it a shot in a little bit here Thanks again Link to comment Share on other sites More sharing options...
Cti Posted September 6, 2007 Author Share Posted September 6, 2007 for some reason, it did not work.replacer.cmd echo/ call:say Message KeyScr cls for /f "usebackq tokens=1,2,3,4 delims=, eol=;" %%a in ( "%scr%") do (Special.cmd:\ChkScr echo/Checking script... exit/b:\RepScr exit/b:\KeyScr exit/b:\CpyBak echo/Backing up exit/bIt says .ReplacerTemp\Special.cmd"" is not a recognized as a internal or external command, operable program or batch file.here is my script.txt as well ;; ReplacerScript; Replacer shell32prog.exe,prog.newThanks Link to comment Share on other sites More sharing options...
jaclaz Posted September 8, 2007 Share Posted September 8, 2007 Right now I have no time to check the file, try leaving the "data" file alone and just remove the "pause" command from replacer.cmd as directed, the messages should flash, but program should work without interruption.jaclaz Link to comment Share on other sites More sharing options...
Cti Posted September 8, 2007 Author Share Posted September 8, 2007 Right now I have no time to check the file, try leaving the "data" file alone and just remove the "pause" command from replacer.cmd as directed, the messages should flash, but program should work without interruption.jaclazOk that worked, but right when it says 1 file swill be replaced a little window comes up and says "windows cannot access the specified device, path, or file. you may not have appropriate permission to access the item" says the location is Replacer\nul, now once I click ok it switches the files, then once finished it says "press any key to quit" I found this in replacer.cmd and removed the pause, but it did not seem to work.Any help is appreciated, I really need this to work.Thank you Link to comment Share on other sites More sharing options...
Cti Posted September 8, 2007 Author Share Posted September 8, 2007 (edited) Right now I have no time to check the file, try leaving the "data" file alone and just remove the "pause" command from replacer.cmd as directed, the messages should flash, but program should work without interruption.jaclazOk that worked, but right when it says 1 file swill be replaced a little window comes up and says "windows cannot access the specified device, path, or file. you may not have appropriate permission to access the item" says the location is Replacer\nul, now once I click ok it switches the files, then once finished it says "press any key to quit" I found this in replacer.cmd and removed the pause, but it did not seem to work.Any help is appreciated, I really need this to work.Thank youEDIT: I have got rid of the error and now just working on making the cmd windows exit without pressing any key Edited September 8, 2007 by Cti Link to comment Share on other sites More sharing options...
jaclaz Posted September 9, 2007 Share Posted September 9, 2007 Just "trace" a little the batch, see which is last action it makes, and add right after it aEXITcommand.jaclaz Link to comment Share on other sites More sharing options...
Cti Posted September 9, 2007 Author Share Posted September 9, 2007 Just "trace" a little the batch, see which is last action it makes, and add right after it aEXITcommand.jaclazThanks for the help, I emailed the guy who made it, I will now post how I did it as jaclaz posted do this Find call:say Message KeyScrpause>nul&clsChange to call:say Message KeyScrclsNow find call:say Messege Finishcall:say Messge KeyExtpause>nulChange tocall:say Messege Finishcall:say Messge KeyExt::pause>nulNow this will make it run fully auto, so you will not have to press any keys add this to the replacer folder, create file named "script.txt" without quotes, for an example we are replacing explorer.exePut this in "script.txt";; ReplacerScript; Replacer shell32explorer.exe,explorer.newput the explorer.exe file in the replacer folder and rename it to explorer.new, now you can make add this to a .cmd filereplacer.cmd script.txtThats all I have to say about that Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now