Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howto:desktop:notepad-portable-with-explorer-integration-for-system-administration [2018-08-05 04:25] (current)
Line 1: Line 1:
 +~~META:
 +creator = Brendan Kidwell
 +&date created = 2014-02-12
 +~~
 +{{tag>​notepad++ portable text-editor windows}}
 +~~DISCUSSION~~
 +====== 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 [[http://​notepad-plus-plus.org/​|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 [[http://​portableapps.com/​apps/​development/​notepadpp_portable|Notepad++ Portable from PortableApps.com]]. Extract it to somewhere convenient such as <wrap file>​%USERPROFILE%\Apps</​wrap>​.
 +
 +===== Configure =====
 +
 +Launch the app and go through <wrap nav>​Settings → Preferences</​wrap>​. Get everything setup the way you like it; this will be your template for all future installations.
 +
 +In particular, I like to have <wrap nav>​MISC. → Remember current session for next launch</​wrap>​ set to ''​false''​.
 +
 +Also, starting from the main menu again, look at <wrap nav>​Plugins → Plugin Manager → Show Plugin Manager → Settings → Notify of plugin updates at startup</​wrap>​. 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 <wrap file>​Notepad++Portable.exe</​wrap>​. These will create and delete shortcuts in your personal <wrap file>​SendTo</​wrap>​ and <wrap file>​Start Menu</​wrap>​ folders.
 +
 +<file dos 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
 +</​file>​
 +
 +<file dos 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
 +</​file>​
 +
 +Compress your <wrap file>​Notepad++Portable</​wrap>​ to a Zip file. Share it in your favorite personal file sharing area. (I like to use [[https://​mega.co.nz|Mega]].)
 +
 +===== Install =====
 +
 +Download your private package. Extract it. Run <wrap file>​install.cmd</​wrap>​.
 +
 +===== Uninstall =====
 +
 +Run <wrap file>​uninstall.cmd</​wrap>​ and delete the application folder.