AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AHK for notepad replacement

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
savage



Joined: 02 Jul 2004
Posts: 207

PostPosted: Tue Oct 19, 2004 3:35 pm    Post subject: AHK for notepad replacement Reply with quote

If you want to totally replace notepad.exe on your system, but don't know where to find a replacment exe for your favorite editor (like ultraedit has), try this.

Code:

replacement = C:\command\vim\vim63\gvim.exe
loop, %0%
{
   Transform, param, deref, `%%A_index%`%
   tail = "%param%" %tail%
}
Run, %replacement% %tail%


Change replacement to whatever editor you like, compile this to notepad.exe and follow the following directions (taken from ultraedit's version).

** Note - You need Administrator access to make these changes (at least
with a properly configured system).

1. In the WINNT\system32\dllcache directory, rename the old notepad.exe
(if it exists) to notepad.exe.bak or something similar so that you'll have
it if you need to go back. (This directory may be hidden.)

2. Copy the attached notepad.exe into your dllcache directory. Windows 2000
will notice the change and pop up a dialog box asking you to insert your
Windows 2000 CD so that it can restore the file. Hit <Cancel>. You will be
asked if you're sure that you want to use the unsigned version; answer <Yes>.

3. After Step 2, you can go ahead and copy your new notepad.exe into
your WINNT and WINNT\system32 directories. You'll get the same dialog
boxes that you did in Step 2; just give the same responses. You're now
ready to roll. (If you do this before Step 1, Windows 2000 will take its
original copy from dllcache and replace your new versions.)

** Note that if you have your Windows 2000 CD in your drive when you do this,
it's possible that instead of popping up a dialog box, Windows 2000 will pull
the old notepad.exe from the CD and replace your new notepad.exe
without any notification. If this occurs, it won't hurt anything,
you'll just have to take the CD out and re-do Steps 1 and 2.


If you want to be really fancy, change replacement to reference an environment variable. Then you can change editors without having to recompile! It'll be like unixes editor variable!

If you're wondering what the loop does, it takes the parameters and builds them into the command tail to be passed to the editor.

PS If you notice that many of my ideas seem half-finished, it's because I just try to provide ideas for those who aren't cripplingly unmotivated. Heh. Smile
Back to top
View user's profile Send private message AIM Address
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Oct 19, 2004 4:51 pm    Post subject: Reply with quote

Nice; and very well documented.

I also like your use of the "Transform Deref" command.

Edit: removed invalid critique


Last edited by Chris on Tue Oct 19, 2004 7:28 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
savage



Joined: 02 Jul 2004
Posts: 207

PostPosted: Tue Oct 19, 2004 5:09 pm    Post subject: Reply with quote

Quote:
compile this to notepad.exe


Heh.

Yeah, that dref command is useful. I use it to loop through parameters in a number of little doodads I use all the time.
Back to top
View user's profile Send private message AIM Address
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Oct 19, 2004 7:27 pm    Post subject: Reply with quote

Quote:
compile this to notepad.exe
I see it now, sorry.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group