LazyBoy Posted March 25, 2006 Share Posted March 25, 2006 This is the batch file I use to replace notepad with notepad2.copy %systemdrive%\notepad.exe %systemroot%\system32\dllcachecopy %systemdrive%\notepad.exe %systemroot%\system32\copy %systemdrive%\notepad.exe %systemroot%\As you can see, this batch file will not work unless I first copy notepad.exe to the C: drive. I put notepad2 with the batch file, so if I can just have batch file copy notepad.exe from the same folder (I put them together), that would save me a lot of trouble. Link to comment Share on other sites More sharing options...
gdogg Posted March 25, 2006 Share Posted March 25, 2006 basically you want to copy your notepad2.exe which would be found in %programfiles%\notepad2\notepad2.exeto do this you'd start withcopy %programfiles\notepad2\notepad2.exe %windir%\system32\dllcache\notepad.execopy %programfiles\notepad2\notepad2.exe %windir%\system32\notepad.execopy %programfiles\notepad2\notepad2.exe %windir%\notepad.exe Link to comment Share on other sites More sharing options...
LLXX Posted March 25, 2006 Share Posted March 25, 2006 (edited) It's called "." but you don't need it. If the batch file is placed in the same directory as the notepad file thencopy notepad.exe %systemroot%\system32\dllcachecopy notepad.exe %systemroot%\system32\copy notepad.exe %systemroot%\is enough to do it. With no paths, current directory is implied, and in this case the current directory also contains the notepad.exe, so it should work. Edited March 25, 2006 by LLXX Link to comment Share on other sites More sharing options...
LazyBoy Posted March 25, 2006 Author Share Posted March 25, 2006 It's called "." but you don't need it. If the batch file is placed in the same directory as the notepad file thencopy notepad.exe %systemroot%\system32\dllcachecopy notepad.exe %systemroot%\system32\copy notepad.exe %systemroot%\is enough to do it. With no paths, current directory is implied, and in this case the current directory also contains the notepad.exe, so it should work.Doh! You're right. I totally forgot about it being implied... Just to make sure though, the variable is "." so it would be ".\notepad.exe" for "'currentfolder'\notepad.exe"? Link to comment Share on other sites More sharing options...
nmX.Memnoch Posted March 25, 2006 Share Posted March 25, 2006 Just to make sure though, the variable is "." so it would be ".\notepad.exe" for "'currentfolder'\notepad.exe"?Correct. 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