it's not malicious. im not a script kiddie or a newbie nerd either.
I write batch files to make my life easier.
the ping simply pauses it. there's no way to pause a terminal for a certain amount of time, but if you go too fast, the file gets an in use error, and if you go too slow then the old notepad gets put back from a replacement. Here, I'll do a description of what all the code does.
CODE
@echo off
echo READ THIS:
echo ..
echo NOTE: just in case, a copy of your old notepad.exe has been made in C:\. this will make a copy of Notepad.exe in your C: folder. WARNING: please ensure neither notepad nor your replacement file are running.
echo ..
echo ..
echo if you stop this prematurely, there will be a new directory in C: called temporaryoldnotepadfolder. It's safe to delete.
echo ..
echo ..
echo ..
these lines simply send you a warning/notice. the only command used is echo
CODE
mkdir C:\temporaryoldnotepadfolder
this makes a directory in C: called temporaryoldnotepadfolder to put your old notepad in temporarily.
CODE
copy C:\Windows\System32\notepad.exe C:\temporaryoldnotepadfolder
this copies your old notepad to this new folder
CODE
move /y %1 notepad.exe
this renames whatever file you drag/dropped onto the batch file to notepad.exe
CODE
move notepad.exe C:\
this puts the new notepad.exe in C:
CODE
pause
this pauses so that you must agree to continue by pressing any key
CODE
REM DIRTY WORK BEGINS HERE
this is like a comment to just say, here begins the replacing.
CODE
echo Beginning...
prints "beginning" on the screen
CODE
ping -n 2 127.0.0.1 >NUL
this pings your local ethernet card for two seconds to create a delay so the file is not in use at the time this command executes. it points the traffic at NUL which is the windows equivalent of /dev/null in unix. I won't explain this line again.
CODE
copy C:\notepad.exe C:\Windows
ping -n 2 127.0.0.1 >NUL
copy C:\notepad.exe C:\WINDOWS\System32
ping -n 2 127.0.0.1 >NUL
copy C:\notepad.exe C:\WINDOWS\ServicePackFiles\i386
ping -n 2 127.0.0.1 >NUL
copy C:\notepad.exe C:\WINDOWS\System32\dllcache
ping -n 2 127.0.0.1 >NUL
this copies the notepad.exe file that was created with more 2 second pauses.
CODE
echo If you received the message "1 file(s) copied." 4 times, this was a success. wait until this is done, then go to start, then run and type notepad, and it should launch your new notepad.
ping -n 2 127.0.0.1 >NUL
this prints a message so that the user can check whether or not the script completed successfully.
CODE
del C:\notepad.exe
move /Y C:\temporaryoldnotepadfolder\notepad.exe C:\
rmdir C:\temporaryoldnotepadfolder\
ping -n 20 127.0.0.1 >NUL
this moves deletes the copy of the new notepad that was made in C: and moves the old notepad that was backed up into C: then it removes the temporaryoldnotepadfolder that was made earlier and waits 20 seconds before closing in case you're still reading that message above.
CODE
REM THIS FILE IS LICENSED UNDER THE CREATIVE COMMONS Attribution-NonCommercial-ShareAlike 2.0
REM YOU CAN READ THE DEED AT: http://creativecommons.org/licenses/by-nc-sa/2.0/legalcode
REM OR THE FULL TEXT OF THE LICENSE AT: http://creativecommons.org/licenses/by-nc-sa/2.0/legalcode
that's just my license code
EDIT:
i just updated the code to do backup work in %TMP% instead of C: and move things to "\windows" in case your main drive isn't C:\