Notepad++ Portable with Explorer Integration for System Administration

In my job, I do a lot of sysadmining on Windows machines, and I’ve also got a collection of Windows development VMs on my desktop. When I’m setting up and troubleshooting applications, I need a decent text editor that doesn’t choke on very large files or files with Unix line endings; Windows’ Notepad is bogative.

There are a lot of good alternatives for Notepad out there, but I specifically want something that is dead simple to install and comes out of the box with a decent configuration. Specifically, I don’t want the text editor to bug me about new version announcements or remember files I had open last time I exited the app. This article shows you a method to prepare your own customized package of the free and open source Notepad++.

You can save this customized package in your personal file sharing space, and drop it on each Windows computer where you want access to a pre-configured text editor without having to think about it.

Download

Notepad++ Portable has no installation procedure; you simply extract the download and run it. The only extra thing you would want is a couple of shortcuts to make it easy to launch; we’ll get to that later.

Fetch Notepad++ Portable from PortableApps.com. Extract it to somewhere convenient such as %USERPROFILE%\Apps.

Configure

Launch the app and go through Settings → Preferences. Get everything setup the way you like it; this will be your template for all future installations.

In particular, I like to have MISC. → Remember current session for next launch set to false.

Also, starting from the main menu again, look at Plugins → Plugin Manager → Show Plugin Manager → Settings → Notify of plugin updates at startup. Setting this to false will save endless annoying popups when you move from one little-used machine to another to make sudden changes.

Package

Create install and uninstall scripts in the same folder as Notepad++Portable.exe. These will create and delete shortcuts in your personal SendTo and Start Menu folders.

Filename: install.cmd
@echo off
cd /d "%~dp0"

:::::::: Parameters

:: Path to Notepad++ Portable
set npp_exe=%~dp0Notepad++Portable.exe

:: Paths to SendTo and Start Menu
for /f "tokens=3*" %%G in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Start Menu" ^|Find "REG_"') do call set _startmenu=%%H
for /f "tokens=2*" %%G in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "SendTo" ^|Find "REG_"') do call set _sendto=%%H


:::::::: Install

cls
echo This script will allow you to 1) install Notepad++ Portable in your SendTo
echo Menu; and 2) install Notepad++ Portable in your Start Menu.
echo.
choice /M Continue
if errorlevel 2 goto :eof
echo.

echo.
choice /M "1) Create SendTo Menu shortcut"
if errorlevel 2 goto :install_startmenu

echo.
echo Creating SendTo shortcut...

echo Set a = WScript.CreateObject("WScript.Shell")>shortcut.vbs
echo Set b = a.CreateShortcut("%_sendto%\Notepad++Portable.lnk")>>shortcut.vbs
echo b.TargetPath="%npp_exe%">>shortcut.vbs
echo b.Description="Notepad++ Portable">>shortcut.vbs
echo b.Save>>shortcut.vbs
cscript //B //NoLogo shortcut.vbs
del shortcut.vbs

echo Done.

:install_startmenu

echo.
choice /M "2) Create Start Menu shortcut"
if errorlevel 2 goto :done

echo.
echo Creating Start Menu shortcut...

echo Set a = WScript.CreateObject("WScript.Shell")>shortcut.vbs
echo Set b = a.CreateShortcut("%_startmenu%\Notepad++Portable.lnk")>>shortcut.vbs
echo b.TargetPath="%npp_exe%">>shortcut.vbs
echo b.Description="Notepad++ Portable">>shortcut.vbs
echo b.Save>>shortcut.vbs
cscript //B //NoLogo shortcut.vbs
del shortcut.vbs

echo Done.

:done
echo.
pause

Filename: uninstall.cmd
@echo off

:::::::: Parameters

:: Paths to SendTo and Start Menu
for /f "tokens=3*" %%G in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Start Menu" ^|Find "REG_"') do call set _startmenu=%%H
for /f "tokens=2*" %%G in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "SendTo" ^|Find "REG_"') do call set _sendto=%%H


:::::::: Uninstall

cls
echo This script will allow you to uninstall Notepad++ Portable from your SendTo
echo Menu and your Start Menu.
echo.
choice /M Continue
if errorlevel 2 goto :eof
echo.

echo Removing SendTo shortcut...
del /q "%_sendto%\Notepad++Portable.lnk">NUL
echo Removing Start Menu shortcut...
del /q "%_startmenu%\Notepad++Portable.lnk">NUL
echo Done.
pause

Compress your Notepad++Portable to a Zip file. Share it in your favorite personal file sharing area. (I like to use Mega.)

Install

Download your private package. Extract it. Run install.cmd.

Uninstall

Run uninstall.cmd and delete the application folder.

Leave a Reply

Please view the Comment Policy before submitting a comment.
 

Your email address will not be published. Required fields are marked *