Some Launchy tweaks

November 15th, 2007

Let’s get nerdy for a second.

The one piece of software I need on my computer is Launchy. When I hit alt+space it brings up a little window from which I can launch any program in my start menu, any bookmark from my favorites (including custom search bookmarks), and even do inline numerical calculations.

Turns out, you can do even more with the clever use of batch files. I found a post on LifeHacker about using Launchy to do more. I started using the custom batch files written in this post but became annoyed with the fact that every time I launched a batch file via Launchy, I’d see a black cmd window pop up to execute the command.

So let’s do it my way.

First, install the following executables to the path C:\WINDOWS:
1) nircmd (this is for commands)
2) curl (this is for http commands)

My buddy pointed out nircmd to me and I realized that with this tool I can do virtually anything through Launchy. Not only did it allow me to successfully launch the batch files silently, but it also gave me a quicker way to shut down and log off of my computer and an easy way to manage window arrangements (minimized, cascaded, etc.). Let me show you an example of how to make nircmd, curl and Launchy work together:

Example 1: Control XBMC with Launchy

1) Make a shortcut to nircmd:

2) Put that shortcut in C:\Program Files\Launchy\Utilities. This will be your template shortcut that you’ll copy and paste as you make new nircmd commands.

3) Make a copy of the shortcut and name it “Play.lnk”

4) Make a new batch file in Launchy’s Utilities directory called “Play.bat”. The file should contain this text (Where “ip#” is the ip number of your Xbox running XBMC with the web server turned on):

@echo off
cd c:\
cmd /c curl --basic http://ip#/xbmcCmds/xbmcForm?command=play
Echo Exiting...

5) Right click Play.lnk and go to “Properties”:

The text box for “Target” should read:

C:\WINDOWS\nircmd.exe execmd "C:\Program Files\Launchy\Utilities\play.bat"

6) No repeat steps 3-5 and replace the active function for “Pause” “Previous” “Next” and “Stop” commands as necessary. Rebuild your Launchy index and you’re good to go. Now you can control your Xbox with launchy.

Example 2: Play albums with Launchy

I also incorporated Launchy into my music listening habits by forcing it to index playlist files on my Music drive. At the time I had no playlist files for any of my albums so I had my friend write a script in lua that will build them automatically (based on my file structure, of course): cobble.zip

To automatically create m3u playlists using this script:

1) Unzip all of the files to the root directory of your music directory

2) Run cobble.bat

Note:
This script will work with a directory structure that looks like: artist\[year] album\files but I’m sure you can figure out how to suit it for your needs. It automatically corrects for conventions such as “Beatles, The” in your folder names and it also makes sure to ignore any files but audio files. At the end you should have an *.m3u file that is formatted as such: The Beatles – Abbey Road.m3u.

3) Bring up Launchy and go to the “Directories” window. Add your music directory and set Launchy to only index m3u files for that directory.

4) Rebuild Launchy’s index.

4 Responses to “Some Launchy tweaks”

  1. josh Says:

    looks like a less pretty version of quicksilver (for mac). and yes, this sort of keyboard-based launching does become addictive.

  2. windwaker Says:

    I regret ever saying anything bad about you; this is epic.

  3. simon Says:

    Impressive.

    So now I can:

    a) launch songs
    b) launch playlists
    c) enqueue songs?

    I want to type “q Song” so I don’t have to destroy my existing playlists.

    any ideas?

  4. Vlad Says:

    the link to the batch file “cobble.zip” isn’t working :\

Leave a Reply