Skip to content

Category: Win 7

Replacing Notepad with Notepad++ using Image File Execution Options

I’ve been irritated for sometime by the apparent lack of desktop real estate when working on many webdev tasks in Windows 7. It may have been the same in WinXP, but honestly it’s been so long I don’t remember. While I don’t profess to be a greybeard or anything like that, I’ve yet to find an IDE that makes my life easier when working on PHP, JS, and CSS especially when most of the time I’m not doing much more than quick fixes.

For the longest time my solution to my conundrum has been to use Notepad2, actually a modified version of it Notepad2 w/ code folding. What I’ve noticed, and what’s prompted me to move away from Notepad2 is that the lack of tabs means that many times I’ll have a half dozen windows open as I try and find and fix whatever craziness I’m working on, and that was a large part of my lack of screen real estate.

My solution was, rather drastically, to dump Notepad2 and move to Notepad++. Unfortunately that brings it’s own issues to the table. The big one, and what prompted this post, is that Notepad++ doesn’t cleanly replace notepad completely. What you can do is have it take over the file extensions for the files you want it to edit. That of course brings it’s own set of problem, namely now your file types all read “Notepad++ file” instead of something more useful like what it actually is.

The best non-destructive way to replace Notepad is to use the Image File Execution Options hook in the registry to have windows launch Notepad++ instead of Notepad. The trick, unlike Notepad2 is that Notepad++ wasn’t apparently designed to be pluged in this way directly. There is a nice, article in the Notepad++ wiki on replacing notepad and that’s what brings me to this post.

The problem I’ve run into is that following their instructions it’s impossible to edit files with either spaces in their name or spaces in the path name. The procedure is the same as outlined by the Notepad++ wiki, only there’s a slight modification to the script that’s used. The the modified script is shown below.

Option Explicit
Dim sCmd, x, arg
sCmd = """" & LeftB(WScript.ScriptFullName, LenB(WScript.ScriptFullName) _
		- LenB(WScript.ScriptName)) _
		& "notepad++.exe" & """"
For x = 1 To WScript.Arguments.Count - 1
	arg = arg & " " & WScript.Arguments( x )
Next
sCmd = sCmd & " """ & trim(arg) & """"
CreateObject("WScript.Shell").Run sCmd, 1, True
WScript.Quit

Note: I’ve split the first sCmd line to make it fit on the page, the splits should work as well in the actual vbs file.

The key here is that script needs to collapse the file name arguments into a single quoted argument, which is what the for loop does now.

Win 7 and Old Hardware

Windows 7 never ceases to amaze me. I recently brought up a Win 7 Home pro box using, some pretty archaic by modern standards hardware. While not the most stellar performer, it does surf the web well enough and considering that was it’s intended mission I’d say it’s been successful.

Actual specs are:

  • Intel P4 2.4GHz Northwood Core (overclocked to 2.6GHz)
  • Asus P4P800 (865PE chipset) motherboard
    • 3COM 3C940 Giga-e LOM
    • On board ADI AD1985 Audio
    • On board VIA 6309 firewire controller
    • SATA via IHC5R
    • 2 UDMA 133 ports via VIA 6410
  • 1.5GB of DDR RAM in dual channel mode (2x 512MB sticks 2x 256MB sticks)
  • nVidia Geforce FX 5700LE
  • 500GB Western Digital SATA Caviar drive

I was utterly impress that not only did everything work, but everything was detected and worked right out of the box. Even installing to the SATA controller which was always a problem for Windows XP. Though I guess I really shouldn’t be so surprised by 9 years of OS development.

None the less, the real concern was performance. Of which the machine scores a blister, okay not really, 3.2 on the Windows Performance index. The limiting factor actually being the CPU.

I don’t know what I found to be more surprising, the fact that all the old hardware worked under the new OS or that the system is just as usable with more features and better security as XP SP3 was on the same hardware.

Sticky Notes and Strike Through

One of my favorite features in Windows 7 (I skipped vista so it may apply there too) is Sticky Notes, the virtual version of their 3M counterparts. I use them mostly the same way too, which means sometimes I want to strike out a completed task instead of simply deleting it from the note or deleting the note.

The solution to the quandary came from a fellow on twitter. Who knew twitter could be helpful?

In a sticky note, select the text you want to strike out and and press CTRL+T. Bam! Stuck out text and you don’t need a tablet and pen to draw a line though it.