Command Line Programming
Off Topic Forum by MoneyAddyct
Posted 10 years, 286 days ago in
I'm using a program called Launchy that's described as a "keystroke launcher." In essence, it's a nifty little program that allows me to launch any file I want very quickly without opening various folders. It's basically a glorified version of the Windows Search utility, but it's great. You can find it here: www.launchy.net . Sometimes, however, I like to open files with a program other than the default program. For example, oftentimes I will open an mp3 with Firefox or Windows Media Player instead of Winamp (which is the default) because I'll have something already set up on Winamp that I don't want to lose by opening another mp3 file. I went on the Launchy message board and asked if there might be a way that I could set up Launchy to open particular files using a non-default application. They said I might be able to do it using the Runny plug-in, which is basically a command line interface. Does anyone have any idea what set of command line commands would allow me to do that? Thanks!
By the way, under "Help" for the Runny plug-in it says: Write a command name and an executable path. Use $1 $2, etc. to mark places where your input will go.
Join or Log in to Reply
I thought maybe something like this would work.
If I type in firefox in launchy and then press tab it'll look like this: firefox |
after the | sign I can type in my variable. So I made the following executable path: file:///C:/Documents%20and%20Settings/Justin/Desktop/Music/$1
because when I actually open up a file using firefox, that's the path I get. So I replaced the name of the file with $1. I set up the command name to be ffo (for firefox open.)
So I tried the following: firefox | ffo | 3 am.mp3
It opened firefox, but it didn't work. It just opened firefox with two tabs open: one had www.3.com in the address bar and the other had www.am.mp3 in the address bar. Any idea what went wrong?
PS: The following works if I type it in: firefox| file:///C:/Documents%20and%20Settings/Justin/Desktop/Music/Black%20Hole%20Sun.mp3. It'll open firefox and play the song. But it won't work with a variable.
Just a suggestion...
It may be getting confused with the space between '3' and 'am.mp3'.
Try putting it in quotes: "3 am.mp3" ?
I don't have any experience with this, but that would be my first guess.
i havent been here in a while...
i always use the "send to" to open any file to what I want to open it to, and not whatever program has attached itself to it.
if you add simple parameters to any program, most of them will load a file on startup, in a batch or CLI type of interface.
ex: c:\program files\sumediaplayer\player2.exe e:\music\pinkfloyd\floyd.mp3
would work for many programs, that leaves the issue of more than one item.
often QUOTES are nessisary
ex: "c:\program files\sumediaplayer\player2.exe" "e:\music\pinkfloyd\floyd.mp3"sometimes other parameters can be applied
ex: c:\program files\sumediaplayer\player2.exe /PLAY e:\music\pinkfloyd\floyd.mp3
sometimes multiples can be opened in a single program, up to the 255 charachterlength of the command line
ex: "c:\program files\sumediaplayer\player2.exe" e:\music\pinkfloyd\floyd.mp3,d:\jewel\goils.mp3,d:\mp3\ledZep\yomama.mp3
different file delimeters can be used for multiples, depending on the program
ex: "c:\program files\sumediaplayer\player2.exe" e:\music\pinkfloyd\floyd.mp3|d:\jewel\goils.mp3|d:\mp3\ledZep\yomama.mp3
so some programs will take a playlist instead, that can partly solve the single item issue.
ex: c:\program files\Winmediaplayer\player2.exe e:\music\pinkfloyd\music3.LST
any program that will load and play a list, this type of thing will work, you just get the list extention that they use correct.
ex: "c:\program files\Winmediaplayer\player2.exe" /PLAYLIST e:\music\pinkfloyd\music3.LST
any quotes nessisary (usually to fix spaces) and any parmeters they need to start automagically.
then any properly programmed winders program will handle a drag and drop
drag the single file that you want to play over the executable or icon for the executable and most programs will autoload that file.
Most Launching tools will maintain the drag and drop aspecs of the file system, even if they implement it internal to the launching program.
In-so-much that your launching program could accept a drag and drop Inside itself , but nothing that a handmade Shortcut couldnt do.
shortcuts of all sorts can have ALL of the stuff above applied to them too, you can make an icon shortcut that will open browser to multiple pages, with most browsers (after you get all the nuances of paremeters correct)
anything else is a system assignment of the "class" of file played (or extension ex:.mp3) by the program assigned it, and is the operating system itself at play, bringing up the program assigned by the operating system to that file type.
In that situation only changing the file/program assignment using a registry trick that is hard to master would work in a launcher. you could use a batch to change the registry, and change it back, its more trouble than its worth, but possible.
those are some ideas , if your only ever passing ONE file to one program, that is very easily done via the "command prompt" or psudo CLI. XP uses a psudo CLI so even it, is "attached" to what is assigned via the registry.
This Poster knows NOTHING about VISTA , if your issue was VISTA related , then it don't apply.