Replace Notepad with Notepad++ using PowerShell

Since Microsoft insists on keeping the traditional Notepad in their latest Windows 10 operating system, I decided to make a script to install and replace notepad.exe with Notepad++. Since Notepad.exe is considered a system file, the script must update the file ownership before Windows will allow the NTFS permissions changes required to replace the executable file.

Note: Windows keeps three copies of Notepad.exe, so the script will backup and replace each of the three Notepad.exe files.

  1. Download and install Notepad++ https://notepad-plus-plus.org/download
  2. Download the replace_notepad.ps1
  3. Open the PowerShell console as administrator from your Windows 10 computer.
  4. Within the PowerShell console, go to the folder that containing the script you downloaded in step 2. For example: cd c:\users\lexh\downloads
  5. Make sure your computer can run scripts by setting the Execution Policy to Unrestricted. To do this, type the following command in the console Set-ExecutionPolicy Unrestricted and press enter.
  6. Press [Y] Yes or [A] Yes to all to change the execution policy.
  7. Run the script by typing the following command: .\replace_notepad.ps1
  8. You will see a security warning, just press [R] Run once to execute the script

You should see one or more success messages confirming your notepad was replaced.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s