logo
  • Jobs
  • About Me
  • Contact
  • Home
« FeedBurner Feeds
Windows Vista and the screensaver »

Replacing Notepad in Windows Vista

Posted November 19th, 2006 by Matt Berther

After installing the Vista RTM, I wanted to replace Notepad with Notepad2, as I find this to be a much more powerful editor. It’s much more geared towards programmers, with built-in syntax highlighting. Best of all, it’s free.

It’s been pretty widely documented on how to replace Notepad on Windows XP. However, not much documentation was available for Windows Vista.

Interestingly enough, I found that it was very easy to do. These are the steps I followed, and I have yet to have Vista to replace it with the built-in version.

  1. Download and extract Notepad2.
  2. Rename Notepad2.exe to notepad.exe.
  3. Find c:\windows\notepad.exe and c:\windows\system32\notepad.exe and set the owner to ‘Administrators’, and grant Administrators full control.
  4. Using Windows Explorer, drag and drop the renamed notepad2.exe to c:\windows and c:\windows\system32.

 Doing this allows you to get a much more powerful editor for things like viewing source from Internet Explorer or off of the Edit context menu.

45 Comments

This entry was posted on Sunday, November 19th, 2006 at 2:57 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Dylan
November 29th, 2006

Thanks for the tip. I also use Notepad2, and I had no problem replacing Notepad with it on XP or XP x64 Edition. Your tip worked like a charm. Just for anybody else out there, if you’re running a 64-bit build of Vista (or XP), you should also replace the notepad.exe found in c:\windows\syswow64.

Lance
January 8th, 2007

Thanks Matt!

Matt Wiebe
January 25th, 2007

Cheers for this. I was despairing of being able to do this (not understanding ownership) but then I realized that early adopters of Vista were precisely the type of people who would 1) want to replace notepad and 2) be able to figure it out. A little Google, and no problem

John Schroedl
February 28th, 2007

Excellent. So much easier than the XP pains we had to go through. Thanks

Guida: Sostituire NotePad in Windows Vista « PuntoDiVista - Il più grande blog monotematico su Windows Vista
March 28th, 2007

[...] Sul sito di Matt Berther invece si trova una soluzione… alternativa… si prende come esempio Notepad2, e lo si sostituisce fisicamente al Notepad di Windows Vista. E’ una breve guida, in inglese. Replacing Notepad in Windows Vista [...]

aBlogByGus - » Notepad2 - Giving it a go…
May 3rd, 2007

[...] Now, I just read a post on Omar’s blog about Notepad2 again and he listed off the four simple steps to take to do what’s needed to really have it replace the old Notepad on Vista. He actually found out about it from another blog (here’s that post too). Either one has the steps and you can download Notepad2 from here too (note there’s a new version out). [...]

FA » notepad2
May 3rd, 2007

[...] 3 yillik bir aranin ardindan notepad2 yenilenmi$, artik ruby icinde syntax highlighting yapiyor.(changelog) xp’de notepad yerine koymak kolay olsa da vista’da nasil yapilabilecegini bulamami$tim fakat $urada notepad yerine nasil replace edilecegi anlatiliyor.(vista’yi bo$una silmi$im ;)) April 26, 2007 18:47 [...]

Odprta koda - Prosto programje » Notepad2
June 4th, 2007

[...] Notepad2 ima poleg omenjenih še precej drugih možnosti, ki nam pri delu pridejo prav. Sam lahko rečem da dokler nisem izvedel zanje jih niti nisem pogrešal, sedaj pa kar ne morem shajati brez njih. Zato sem z uporabo določenih posegov lahko originalni Notepad popolnoma nadomestil z Notepad2. Tule so navodila kako to storimo na Windows XP, XP SP2 in Windows Vista. [...]

David Chan's Brain Barn » Blog Archive » Replacing Notepad with Notepad2
July 13th, 2007

[...] you use Windows Vista, follow the simple instructions here. [mattberther.com] Quick actions for “Replacing Notepad with Notepad2″:  Trackback address [...]

akaine
November 15th, 2007

nice solution… a question though:
where the heck vista gets the old notepad from when some notepad-viewable files like *.reg or *.txt for ex. are opened by selecting “Edit” option in the context menu using explorer?
(Vista x64)

Alexey Romanov
December 3rd, 2007

I have changed ownership on notepad.exe files. Unfortunately, I get “Folder Permission Denied” if I copy in Explorer and “Access denied” if I try to do it from command line with administrator rights.

all2ez
February 1st, 2008

Alexey,

You still have to change the permissions on the file after you change ownership. The “grant Administrators full control” part of step 3 above probably could’ve been a separate step.

John
April 3rd, 2008

Is it possible to soft link the exe file? I keep notepad2 in c:\tools and would like to keep it there..

CTH
April 3rd, 2008

akaine >> there’s another one in C:\Windows\SysWOW64

MelDJ
April 7th, 2008

Why notepad2 puts the microprocessor to 50 % in windows vista?

Elegant Code » Changing File Ownership In Vista and Longhorn
April 7th, 2008

[...] I ran into an issue with overwriting the original notepad due to a lack of permissions. I found Matt Berther’s article which helped me understand what files needed to be overwritten for use in Vista. While I ran into [...]

azərbaycan test öğəı ş çü at SƏNƏTKAR.COM
May 16th, 2008

[...] The installation file weighs in at 247KB, a small amount of data for such a feature-rich notepad. Another bonus is you can also replace the default Notepad that comes with windows with Notepad2, which you can view howto’s for Windows XP and Windows Vista. [...]

10 Essential Free Software Programs ~ Tech Blog by Bram Cool
May 21st, 2008

[...] Replacing Notepad in Windows Vista [...]

kipp
June 1st, 2008

can you guys explain it step by step? how do i set the owner in vista 64-bit?

“Set, View, Change, or Remove Special Permissions” i’ve checked this but the “add” button is greyed out.

can someone make simple 1, 2, 3, 4 that is ‘more’ elaborate than the original post? also how do i set up the ini permissions? word wrap settings are never saved between sessions. thanks

kipp
June 1st, 2008

3a. right-click > properties > security > click “advanced” > owner > select “administrators” > click “apply/ok” > click “ok” on each window to exit.

3b. right-click > properties > security > click “edit” > select “administrators” > select the “full control” check box > click “ok” on each window to exit.

wasn’t so hard to give a bit more detail was it? or make a batch file. suppose it was too much effort!

yeranui
July 1st, 2008

Thanks to Matt on the tutorial to how to replace Notepad2 for the old boring Notepad. For a newbie like me, was very easy.
I love better the color syntax of Notepad2

SK
July 15th, 2008

Thanks kipp for fleshing out those steps. I’m a Vista newb and needed the extra help. :)

John Parson
July 21st, 2008

Some windows updates will overwrite notepad2.exe so you may have to do the whole process over again. Bill should just buy notepad2.exe and make it part of Windows.

Tom Loredo
July 25th, 2008

I followed the steps but every time I start Notepad my settings are not saved…I have to reset them every time, did I do something wrong?

Shaun
July 29th, 2008

You have to run notepad.exe as root (the ’super administrator’ in Vista) to save settings.

Unfortunately, Vista does not allow compatibility mode to be set for notepad.exe in the Windows directory. If you need to change and save program settings often, it may be better to put Notepad2.exe in program files and tell Windows to use Notepad2.exe instead of notepad.exe for text files and the like.

Helper
July 31st, 2008

To ensure notepad2 can save setting changes copy notepad.ini into the system32 folder and allow users modify control of the notepad.ini. I myself just gave user full control and I tested a change and it held fine.

Notepad2 3.0.20 RC1 : Press play on Tape!
August 22nd, 2008

[...] Ihr einfach nur das Paket entpacken und die replace.cmd ausführen. Vista Nutzer lesen sich das [...]

Notepad2 3.0.20 RC 2 : Press play on Tape!
September 14th, 2008

[...] Ihr einfach nur das Paket entpacken und die replace.cmd ausführen. Vista Nutzer lesen sich das [...]

James
October 27th, 2008

There is another way to do this without replacing Microsoft’s version of Notepad, which will keep working pretty much forever:

Save the following script as D:\Utilities\ExecuteNotepadIFEO.js (after updating the path to Notepad2.exe in this script):

— START SCRIPT —

if( WScript.Arguments.length>0 )
{
var shell=new ActiveXObject(”WScript.Shell”);
var args=”";

for( i=1; i<WScript.Arguments.Length; i++ )
{
args+=WScript.Arguments(i)+” “;
}

shell.Exec(”D:\\Utilities\\notepad2.exe ” + args);
}

— END SCRIPT —

Then save the following as Notepad2.reg (after making sure the path to the .js file exists:

— START REG —

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
“Debugger”=”wscript D:\\Utilities\\ExecuteNotepadIFEO.js”

— END REG —

And like magic, any attempt to execute anything named notepad.exe will start up notepad2. (The .js script is needed to strip off arguments that shouldn’t be passed to notepad2).

Notepad2 3.0.20 : Press play on Tape!
November 1st, 2008

[...] Ihr einfach nur das Paket entpacken und die replace.cmd ausführen. Vista Nutzer lesen sich das [...]

kkm
November 11th, 2008

@kipp,
thanks, What gives? For what we need complicate setting batch.
We dont need script. We need brain for setting!!

kelvin

Press play on Tape! » Notepad2 2.1.19
November 26th, 2008

[...] müsst Ihr einfach nur das Paket entpacken und die replace.cmd ausführen. Vista Nutzer lesen sich das [...]

Notepad2 « Nothing personal
December 12th, 2008

[...] about replacing notepad with notepad2, the following steps worked for me on Windows [...]

Notepad2 | Tea Break
December 12th, 2008

[...] about replacing notepad with notepad2, the following steps worked for me on Windows [...]

Chris Colden
December 24th, 2008

I have created a script which will install notepad2 and backup notepad. Just make a batch file with the following lines in and save it into the extracted notepad2 folder.

Cheers, Chris

takeown /f c:\windows\notepad.exe
cacls c:\windows\notepad.exe /G Administrators:F
takeown /f c:\windows\system32\notepad.exe
cacls c:\windows\system32\notepad.exe /G Administrators:F

COPY c:\windows\notepad.exe c:\windows\notepad.exe.bak
COPY c:\windows\system32\notepad.exe c:\windows\system32\notepad.exe.bak

COPY Notepad2.exe c:\windows\notepad.exe
COPY Notepad2.exe c:\windows\system32\notepad.exe

catching
December 27th, 2008

If you want to remember the settings you will have to change the permissions of the settings.ini file also.

nopa
January 31st, 2009

Thanks for the workaround! Now there’s gotta be one for Wordpad ;)

darco
February 9th, 2009

chris colden has it exactly right. to specify, his method worked for me in vista ultimate sp1 x86

in the folder you extracted notepad2.exe to… make a new text file and rename it replace.bat … open this text file with notepad and put in the following text:

takeown /f c:\windows\notepad.exe
cacls c:\windows\notepad.exe /G Administrators:F
takeown /f c:\windows\system32\notepad.exe
cacls c:\windows\system32\notepad.exe /G Administrators:F

COPY c:\windows\notepad.exe c:\windows\notepad.exe.bak
COPY c:\windows\system32\notepad.exe c:\windows\system32\notepad.exe.bak

COPY Notepad2.exe c:\windows\notepad.exe
COPY Notepad2.exe c:\windows\system32\notepad.exe

… then save, close the window, and run the file. it will prompt you to replace, so youll press “y” twice. thanks again chris

brian
February 11th, 2009

Thanks darco, works perfectly! :)

webdesign heilbronn
February 15th, 2009

Thanks a lot Matt, it works perfectly.

Greatz

Steve

Mehtuus
February 25th, 2009

Thanks Chris! The commands worked perfectly once I found out that UAC had to be disabled and the system rebooted first. Below is an updated version of the batch file that I successfully used on my Vista x64 Ultimate install:
=================================================================

rem START BATCH COMMANDS
rem USER ACCOUNT CONTROL (UAC) MUST BE TURNED OFF AND SYSTEM REBOOTED **FIRST** BEFORE THIS WILL WORK!
rem If you are using VISTA x32 version, then close this window BEFORE continuing and edit this file by putting “rem ” in front of every line that contains the text “syswow64″. Then run this file again.
@echo off
PAUSE

takeown /f c:\windows\syswow64\notepad.exe
cacls c:\windows\syswow64\notepad.exe /G Administrators:F

takeown /f c:\windows\system32\notepad.exe
cacls c:\windows\system32\notepad.exe /G Administrators:F

takeown /f c:\windows\notepad.exe
cacls c:\windows\notepad.exe /G Administrators:F

copy c:\windows\syswow64\notepad.exe c:\windows\syswow64\notepad.exe.backup
copy c:\windows\system32\notepad.exe c:\windows\system32\notepad.exe.backup
copy c:\windows\notepad.exe c:\windows\notepad.exe.backup

copy notepad2.exe c:\windows\syswow64\notepad.exe
copy notepad2.exe c:\windows\system32\notepad.exe
copy notepad2.exe c:\windows\notepad.exe
@echo on
rem END BATCH COMMANDS

Pieter
May 2nd, 2009

Doesn’t seem to work on windows 7 (there is a “TrustedUser” who seems to have all the rights)

Ralin
May 10th, 2009

To replace the files in Windows 7, take ownership of the notepad.exe-file in SysWOW64 and System32, then add write/modify-permissions to Administrators and simply copy it over.
I ran explorer.exe as administrator too, so if above doesn’t work run explorer.exe as administrator.

Yo
May 27th, 2009

On Windows 7 the replacement by mentioned scripts work, as long as the .bat or .cmd file is ran as Administrator.

I also had to copy Notepad2.ini to C:\Windows folder and grand full permission to my userID to assure Setting changes of Notepad2 settings get saved.

selyb
August 29th, 2009

Replace a System Program without Modifying System Files or Permissions

uses ‘Image File Execution Options’ registry key

Full tutorial and sample scripts here

http://www.vistax64.com/tutorials/244527-programs-replace-system-program-without-modifying-system-files-permissions.html

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
-->

flag
Favorite Charity
wounded warrior project
Search
Social
  • mattberther on twitter
  • mattberther on linkedin
Syndication
Archives
  • January 2010
  • September 2009
  • July 2009
  • June 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • September 2008
  • August 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004
  • September 2004
  • August 2004
  • July 2004
  • June 2004
  • May 2004
  • April 2004
  • March 2004
  • February 2004
  • January 2004
  • December 2003
  • November 2003
  • October 2003
  • September 2003
  • August 2003
  • July 2003
  • June 2003
  • May 2003
  • April 2003
  • March 2003
mattberther.com © 2003 - 2010