AutoHotkey Community

It is currently May 27th, 2012, 7:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: October 19th, 2004, 4:35 pm 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
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. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2004, 5:51 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Nice; and very well documented.

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

Edit: removed invalid critique


Last edited by Chris on October 19th, 2004, 8:28 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2004, 6:09 pm 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2004, 8:27 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Quote:
compile this to notepad.exe
I see it now, sorry.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group