This is number four in my series of short tricks and tips.
I debated about the utility of this until I spent an hour trying to figure out how to search MaxL scripts with Windows Explorer’s Search function.
The fix is easy and oh so useful.
What am I trying to do?
Let’s say I want to find all of the MaxL scripts that use the “spool” command.
If I searched all of the .txt files in a given folder, Explorer’s Search function would give me a nice list of files that contain the string “spool” in the file body.
To prove this, I renamed a MaxL file so that it has an extension of .txt.
Here are the results:
But if I search the same folder for the same file with a .msh extension I get this:
Of course, I could:
1) Find every MaxL script (in my world, they end with a .msh, and yes, that is important) in a given folder, harddrive, computer, etc.
2) Open up every one of those MaxL scripts and search within for “spool”.
But there is a Better Way. The cockroaches of Sidi-Bel-Abbes will thank me for that one.
Don’t fear the Registry
Go to the Start->Run menu and type regedit.
A key is required
If you’ve already changed .msh files in Explorer to open with Notepad or my personal favorite TextPad, this step isn’t necessary as the main key will exist in the registry.
Add a new Key:
The Registry Editor will stick this new key at the bottom of the list – don’t worry about the order.
Rename the selected text to .msh and hit Enter.
Tell Search to look inside .msh files
Add another new key to the .msh key – I guess you could call this a subkey – by right clicking on .msh.
Here’s what it looks like:
Now give that key a default String value:
It is not going to be set by default.
Right click on (Default) and select Modify.
Now we need to give the Default key a very specific value. Just copy and paste this into Regedit:
After you click on OK, you should see the following:
Log off and log back on; rebooting shouldn’t be necessary.
Search now lets you look inside .msh files.
Not a big deal, or the world’s best hack, but it sure is a nice way to search for a string within a non-standard file type. Of course you can extend this technique to .csc, .rep, and .whatever files you need to scan. Useless 99% of the time, but when you need it, you need it.
Happy hacking till next time.