SEARCH

How-To Geek

How To Replace Notepad in Windows 7

It used to be that Notepad was a necessary evil because it started up quickly and let us catch a quick glimpse of plain text files. Now, there are a bevy of capable Notepad replacements that are just as fast, but also have great feature sets.

Before following the rest of this how-to, ensure that you’re logged into an account with Administrator access.

Note: The following instructions involve modifying some Windows system folders. Don’t mess anything up while you’re in there! If you follow our instructions closely, you’ll be fine.

Choose your replacement

There are a ton of great Notepad replacements, including Notepad2, Metapad, and Notepad++. The best one for you will depend on what types of text files you open and what you do with them. We’re going to use Notepad++ in this how-to.

The first step is to find the executable file that you’ll replace Notepad with. Usually this will be the only file with the .exe file extension in the folder where you installed your text editor. Copy the executable file to your desktop and try to open it, to make sure that it works when opened from a different folder.

In the Notepad++ case, a special little .exe file is available for the explicit purpose of replacing Notepad.If we run it from the desktop, it opens up Notepad++ in all its glory.

sshot-1

Back up Notepad

You will probably never go back once you switch, but you never know. You can backup Notepad to a special location if you’d like, but we find it’s easiest to just keep a backed up copy of Notepad in the folders it was originally located.

In Windows 7, Notepad resides in:

  • C:\Windows
  • C:\Windows\System32
  • C:\Windows\SysWOW64 in 64-bit versions only

Navigate to each of those directories and copy Notepad.

sshot-2

Paste it into the same folder.

sshot-3

If prompted, choose to Copy, but keep both files.

sshot-4

You can keep your backup as “notepad (2).exe”, but we prefer to rename it to “notepad.exe.bak”.

sshot-6

Do this for all of the folders that have Notepad (2 total for 32-bit Windows 7, 3 total for 64-bit).

Take control of Notepad and delete it

Even if you’re on an administrator account, you can’t just delete Notepad – Microsoft has made some security gains in this respect. Fortunately for us, it’s still possible to take control of a file and delete it without resorting to nasty hacks like disabling UAC.

Navigate to one of the directories that contain Notepad. Right-click on it and select Properties.

sshot-7

 

Switch to the Security tab, then click on the Advanced button.

sshot-8

Note that the owner of the file is a user called “TrustedInstaller”.

sshot-9

You can’t do much with files owned by TrustedInstaller, so let’s take control of it. Click the Edit… button. Select the desired owner (you could choose your own account, but we’re going to give any Administrator control) and click OK.

sshot-10

You’ll get a message that you need to close and reopen the Properties windows to edit permissions. Before doing that, confirm that the owner has changed to what you selected.

sshot-11

Click OK, then OK again to close the Properties window. Right-click on Notepad and click on Properties again.

Switch to the Security tab. Click on Edit….

sshot-12

Select the appropriate group or user name in the list at the top, then add a checkmark in the checkbox beside Full control in the Allow column.

sshot-14

Click OK, then Yes to the dialog box that pops up.

sshot-15

Click OK again to close the Properties window.

Now you can delete Notepad, by either selecting it and pressing Delete on the keyboard, or right-click on it and click Delete.

sshot-16

 

You’re now free from Notepad’s foul clutches!

sshot-17

Repeat this procedure for the remaining folders (or folder, on 32-bit Windows 7).

Drop in your replacement

Copy your Notepad replacement’s executable, which should still be on your desktop.

sshot-18

Browse to the two or three folders listed above and copy your .exe to those locations. If prompted for Administrator permission, click Continue.

sshot-19

If your executable file was named something other than “notepad.exe”, rename it to “notepad.exe”. Don’t be alarmed if the thumbnail still shows the old Notepad icon.

sshot-20

Double click on Notepad and your replacement should open.

sshot-21

To make doubly sure that it works, press Win+R to bring up the Run dialog box and enter “notepad” into the text field. Press enter or click OK.

sshot-22

sshot-23

Now you can allow Windows to open files with Notepad by default with little to no shame! All without restarting or having to disable UAC!

Trevor is our resident Linux geek, but always keeps his eyes open for neat Windows tricks too.

  • Published 03/9/10

Comments (44)

  1. MiCHi

    Well, nice tuto. I only add that if you are using portable mode you must create a registry key:

    x64:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Notepad++]
    @=”PATH”

    x86:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Notepad++]
    @=”PATH”

    in other way the small utility will not work, those, who installed notepad++ from installer don’t need to do this step (i actually had to)

  2. marcus

    replaced notepad with notepat++. however, when I try to launch the “new” notepad I get an error saying that loading langs.xml failed. what do I do?

  3. SquareWheel

    I use Notepad++ all the time, but I don’t think I would want to replace my original notepad with it.

  4. MrDolomite

    That seems like an insane amount of work. Why not just associate the .TXT files to open with a different application?

  5. Dave Landry

    You state : “In the Notepad++ case, a special little .exe file is available for the explicit purpose of replacing Notepad.”

    Where is this file available? It isn’t included in the dist package

    Nice writeup

    D

  6. Bruno Casarini

    I’ve been using EditPad for years now, and it can be set to replace Windows Notepad with no hassle – just by checking an option in its config menu.

  7. Fred King

    I’ve used EditPlus for about 6 years now and can’t imagine working without it. Customize it with tabs and color coded keywords.

  8. Senax

    There is another way: Image File Execution Options
    described here:

  9. Senax

    Something’s eating the URL!!1

    www . flos – freeware . ch / doc / notepad2 – Replacement . html

  10. John Braine

    I like the idea. Even though I usually fire up notepad++ straight from launchy but after doing all that I’m getting all kinds of errors when I try to run it now.

    Starts with “Load langs.xml failed”
    Then Can not laod the dynamic library
    And several more.

    Will see if a classic restart helps when I have a chance.

  11. Trevor Bekolay

    @Senax

    That URL points here. Looks like an interesting alternative for people who don’t want to change their Windows directories. Of course, it requires changing the registry, so choose which method is more palatable to you.

    I use the method presented above because I can repeat it easily at any computer I go to without having to refer back to a webpage to find the exact registry key to change. Because I can do everything through the GUI, it sticks in my memory easier, for whatever reason.

  12. Trevor Bekolay

    @Dave Landry

    The file is available on the Notepad++ website under “Notepad replacement” — or you can use this direct link.

    For those that are having problems with langs.xml not loading and things like that, did the program open properly when you copied it to the desktop and tried opening it from there? Some text editors store information in separate files (like langs.xml) and so you may need to copy those files into the Windows directories as well.

    In the case of Notepad++, the little file (linked above) is basically like a Windows shortcut, and just opens up the Notepad++ file in its installed directory, so it uses the configuration files there. Other text editors may have similar ways of doing this.

  13. John the Editor (John Cooper)

    I second MrDolomite. I don’t understand the point. I’ve had Notepad++ for a couple of years and reset my associations, and I don’t remember the last time Notepad opened on me.

  14. jarmod

    Appreciate the recommendations generally but this one seems to be of the ‘sledgehammer to crack a nut’ variety. Just install your notepad replacement normally, change the TXT association to the new program, and then add an ‘Open with ‘ context menu if the program doesn’t already do that (which is probably does already).

  15. Lex Li

    As more and more people move to x64, most “enhanced notepad” such as Notepad++ becomes less useful, as they cannot be used to open files in x64 folder (such as Windows\system32) as they don’t have a x64 build.

    Currently I am using Notepad2 from here, http://code.kliu.org/misc/notepad2/ and its installer can help replace default Notepad easily.

  16. Trevor Bekolay

    @Lex Li

    I’m not sure what you mean by 32-bit programs not opening files in 64-bit folders? I’m using Notepad++, which is a 32-bit app and it works fine…

  17. Joe Blough

    And all this clicking around, changing permissions, ownership, etc, is all this an improvement over what I can do running win-98? I laugh at all this. What a joke.

  18. darjeeling

    Configuring in notepad is very simple and easily handle. This technique is very helpful.

  19. Daniel Black

    MrDolomite ++

    I use Notepad2, and merely change the .TXT file association. It’s a charmingly simple alternative that is much easier to revert or change. Remember: you may not want to use Notepad2, and may prefer either Notepad, or another alternative. Choose the method that allows the lowest friction.

  20. Martin

    I use Notepad2 in Windows 7 x64 with the “Open in notepad” context menu reg fix to open every text files (.txt, .php sources, .css, etc). It has a nice syntax coloring function and is very, very lightweight.

    Besides, sorry, but Notepad++ has an ugly icon.

  21. spider1163

    Hello,
    your article is perfect,
    this is the only one solution I found on the web to replace notepad with notepad++
    (I only found with notepad2)
    thanx a lot !

    PS: here is a trick:
    install notepad++ first & you won’t need to edit registry, and no need to manually update !

  22. James Bearden

    Okay so I really need some help I’m like OCD and this bug’s me so bad, so I took notepad++ little replaceing exe and threw it in all the place’s and like it for a while then decided to go back and reshack all the icon’s to the default notepad icon’s that way it looked nicer, so far so good, then I was using everything like normal but me being OCD decided that I don’t like the way it say’s “notepad.exe” in the “open with” menu for new file type’s for like .abc and what not when you have to select a program to open said file type with, so I have spent the last hour or so reshacking .exe property details into the exe to no success, does anyone have a way to rename the “notepad.exe” to “Notepad” like the other program’s?

  23. Phil

    This is the only way of doing it right. Thanks a lot for the writeup, really helped me a lot. A link to the little exe that comes with notepad++ would have been nice in the original article though.
    Cheers
    Phil

  24. CurtJM

    For those who are wondering why not to just change the file associations – some software that has commands to edit text and config files built into them automatically opens notepad with no option to use another editor, and will bypass file associations. When this is the case it is necessary to follow the instructions above to get a different editor to open it.
    In my case it is a WAMP package called Vertrigo Server. It has a quick option built into it that allows me to easily open up some server config files, but it’s hard coded to use the …\windows\notepad.exe path which would be ok if I wanted to use notepad, but when I edit them using Notepad++ I get all the extra options, and colour coding too. Well worth following the simple steps above to get what I want.

  25. Richard

    Kudos for the process. And kudos to CurtJM above who intelligently lays out why notepad replacement can be useful, rather than all the knuckledraggers whining and complaining about what they don’t understand. Personally, I just used a command prompt to do all my work . . .cacls, takeown, xcopy, etc, etc. :) Also, if anyone is worried they’ll break something, install VirtualBox, create a new VM of your OS and practice until you get it right. You can always get rid of the changes by reverting your VM back to a previous snapshot. Voila!

  26. Offbeat Dave

    This is the only way I’ve found to do this that works! Thankyou. Very easy and I don’t know why anyone seems to think that it is tricky or takes a lot of effort. After installing Notepad++ first, this ‘fix’ took 1min and 4 seconds (yes I was that sad and timed it!)

    “Appreciate the recommendations generally but this one seems to be of the ’sledgehammer to crack a nut’ variety. Just install your notepad replacement normally, change the TXT association to the new program, and then add an ‘Open with ‘ context menu if the program doesn’t already do that (which is probably does already).”

    But associating *.txt files etc doesn’t help when you want to right click, say a *.bat file and click edit. This fix does all that.

    Again, thankyou!

  27. Johny

    An alternative to going through all that GUI just to take owenership of that one notpad.exe file, why not just do some context menu tweak and add it as an option in the context menu?

  28. Carlo

    If you are getting the ‘loading langs.xml failed’ error, copy the langs.xml file to the Windows directories you copied notepad.exe to (the renamed notepad++ executable).

  29. Elliot Boney

    I was having a hell of a time getting notepad++ to work on my 64bit system but i found a link to a utility called “notepad launcher” from the notepad++ wiki. it can be found here
    h t t p ://wiki .przemoc.net/ projects/start#notepad_launcher

  30. thedude

    does not work for me on my 64 bit win 7.

    an exception occured. notepad++ cannot recover and must be shut down

    the expection details are as follows:
    code 0xC0000005
    type: access violation
    exeption adress: 0x00000000

  31. nick

    There are lots of things I open with notepad and the extensions can be random. Obviously txt isn’tt he only thing a lot of people use notepad for. If this isn’t you then maybe screwing with the extensions works, but unlike you I will never ever see notepad again EVER… which is a good thing

  32. Phil

    Look at this http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Replacing_Notepad

    You have to download notepad.exe (notepad++) replacement and use this file to replace notepad by notepad++

  33. Mark

    This post is a misleading. There is no special little notepad.exe included with notepad++, you need to download it from http://notepad-plus.sourceforge.net/commun/misc/NppLauncher.bin.zip.

    If you rename notepad++.exe to notepad.exe and copy it to those locations the lang.xml error occurs in 64bit Windows 7.

  34. Fooled Again

    This article is a piece of shit.

  35. Fooled Again

    Oh, I get it, its written by an illiterate and lazy Linux asshole

  36. Laurence Evans

    Batch file I use to replace notepad – just need to grab your replacement file (named notepad.exe) along with this batch file on the root of your windows drive, run as admin and should be good to go!

    @echo off

    set ReplaceNotepad=%cd%\notepad.exe
    %systemdrive%
    cd %windir%
    FOR /F “tokens=*” %%n IN (‘dir /b notepad.exe /s’) DO (
    takeown /f %%n
    echo Y|cacls %%n /Grant %USERNAME%:F
    copy %ReplaceNotePad% %%n
    if errorlevel 1 call :whoops %%n
    )

    set ReplaceNotePad=
    pause
    goto :exit

    :whoops
    SETLOCAL ENABLEEXTENSIONS
    SETLOCAL ENABLEDELAYEDEXPANSION
    set OriginalNP=%1
    set NPPath=!OriginalNotePad:~0,-12!

    REM Fix if issue is that NotePad.EXE is in use
    move !OriginalNP! !NPPPath!\notepad.original
    copy %ReplaceNotePad% !OriginalNP!
    if not errorlevel 1 goto :continue

    REM Fix if issue is also directory permissions
    takeown /f !NPPath!
    echo Y|cacls !NPPath! /Grant %USERNAME%:F
    move !OriginalNP! !NPPPath!\notepad.original
    copy %ReplaceNotePad% !OriginalNP!
    goto :continue

    :continue
    echo ***
    echo *** After next reboot, delete the locked file
    echo *** !NPPPath!\notepad.original
    echo ***
    goto :exit

    :exit

  37. mossy

    Something is wrong with this article for Win 7 Home Premium. Can’t copy even when set to Administer with full control. So can’t even get the point of making two files so that you can rename one.

  38. BPJ

    Thanks,

    Followed above procedure to make it work + copy dll files required for Notepad++.

  39. Dwight

    Easier: just install notepad++ and drop this into an elevateed command prompt

    takeown.exe /F c:\windows\notepad.exe
    takeown.exe /F c:\windows\system32\notepad.exe
    ICACLS c:\windows\notepad.exe /grant administrators:F
    ICACLS c:\windows\system32\notepad.exe /grant administrators:F
    del c:\windows\notepad.exe
    del c:\windows\system32\notepad.exe
    copy “C:\program files\notepad++\notepad++.exe” c:\windows\notepad.exe

  40. JOE

    Don’t try it on Win 7 64 bit.

  41. hart

    REPLY TO : thedude
    an exception occured. notepad++ cannot recover and must be shut down

    the expection details are as follows:
    code 0xC0000005
    type: access violation
    exeption adress: 0×00000000

    I had this error come up in Windows 7 when I tried to run Notepad++, it was unrelated to replacing notepad.exe. It occurred because N++ was trying to reopen an invalid file.

    To correct it I deleted the file tags in the N++ Session.xml file, stored at:
    C:\Users\%UserName%\AppData\Roaming\Notepad++\Session.xml

    /posted here because it was first google result for error code.

  42. Pablo

    REPLY TO : hart

    It is works for me!! thanks so much.

  43. Zotov

    For all people struggling to make it work on the Windows 7 64bit, catch this link: (look at the end of the thread) http://sourceforge.net/projects/notepad-plus/forums/forum/331753/topic/3469048
    Download, unzip, run executable with administrative rights. You’re done.
    And it also comes with uninstaller.
    So don’t waste your time on the method described in this article.

  44. ne gereği var :)

Enter Your Email Here to Get Access for Free:

Go check your email!