Jump to content

Somone please help me with replacer.cmd ?


Cti

Recommended Posts

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,Optional

replacer.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 you

EDIT:

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 script

I want it to be fully unattended ??

thanks

Edited by Cti
Link to comment
Share on other sites


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 installed

please 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

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.vbs

Special.cmd

Zap.exe

Open 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/b

You 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&cls

change this:

pause>nul&cls

to:

cls

to 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

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/b

It 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 shell32
prog.exe,prog.new

Thanks

Link to comment
Share on other sites

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

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

Ok 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

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

Ok 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

EDIT: I have got rid of the error and now just working on making the cmd windows exit without pressing any key

Edited by Cti
Link to comment
Share on other sites

Just "trace" a little the batch, see which is last action it makes, and add right after it a

EXIT

command.

jaclaz

Thanks 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 KeyScr
pause>nul&cls

Change to

call:say Message KeyScr
cls

Now find

call:say Messege Finish
call:say Messge KeyExt
pause>nul

Change to

call:say Messege Finish
call:say Messge KeyExt
::pause>nul

Now 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.exe

Put this in "script.txt"

;; ReplacerScript
; Replacer shell32
explorer.exe,explorer.new

put the explorer.exe file in the replacer folder and rename it to explorer.new, now you can make add this to a .cmd file

replacer.cmd script.txt

Thats all I have to say about that :thumbup

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...