Makling new commands Thread last updated on 2003-07-17 00:21:58

Posted by member 27923 on 2003-06-08 17:59:24

Ok so, there's this game I play alot and I don't have a shortcut or anything for it so I usually have to get to it my going through a few folders. I'm wondering if I can make a simple command that'll run the game. I'd also like to do this for a few other programs.

Posted by member 2112 on 2003-06-08 18:14:59 link

What sort of "command" did you have in mind? You could use Hotkey.dll to create a hotkey to launch the application. Or you could create a shortcut button for it in your theme using shortcut2.dll. Or you could edit popup.rc and create a link for it. Or you could simply create the shortcut icon for it in your .../Start Menu/Programs folder so it appears in the theme popup like other programs.

Posted by member 27923 on 2003-06-08 18:16:55 link

Oh yea, I'm talking about an !bang command. ;)

Posted by member 2184 on 2003-06-08 19:25:18 link

make a text file, in the file have

@echo off
start c:\path\filename
end


Save it in your windows directory, name it game.bat, game = game name, or whatever you whant.

when you whant to play it just type game (or whaever) in a command prompt and bada bing!

I use this to launch many things at once too.

.bat files dont suport long file names so "c:\program files\" would look like this "c:\progra~1\" this is only if the path or file name is longer than 8 chars.

Posted by member 32550 on 2003-06-08 19:33:17 link

hmmm.... there are commandalias like:
*CommandAlias "$programdir$\games\game1\start.exe" "!game1"

for lsxcommand, else you can do things like:
!execute ["$programdir$games\game1\start.exe"]


both are working very well

Posted by member 2184 on 2003-06-08 23:07:07 link

Hey!

ya learn something new everyday, ^thats way easier^ !

I have some batch files to delete =)

Posted by member 32550 on 2003-06-09 06:05:07 link

ooops... sorry, the !execute part is just for shortcuts, I'm sorry, so take the commandalias :) *hides*

Posted by member 27923 on 2003-06-09 13:20:13 link

Hehehe, thanks a bunch. ;)

Posted by member 1316 on 2003-06-09 13:42:36 link

aquatron, this isn't even related, but .bat files do support long file names. at least in win2k-xp, maybe not in 9x. I have a few I use at work that (among other things) do something with "c:\documents and settings\...". the trick is, if there are any spaces, then it needs to be in quotes. fyi

Posted by member 2184 on 2003-06-09 14:57:28 link

ahhh IC

Posted by member 11905 on 2003-06-09 15:35:28 link

::noob:: umm where does the commandalias bit go? ::noob::

Posted by member 99 on 2003-06-09 15:51:21 link

!execute is only needed when you have two commands you want to group together, or if the command you want starts with a special character like #. I see a lot of people using !execute where it's really unnecessary.

Another way to create bang commands is with mzScript, and you can do a lot with that.

Posted by member 27923 on 2003-06-12 19:04:39 link

Another question about commands...

How would I go about making a command to open up a folder?

By the way, the command alias didn't work for my game.

!crs "$Documents$\_files\_programs\CH010912\LATEST.exe"


Is the code I put in.

Posted by member 1316 on 2003-06-13 08:12:28 link

try this: "!crs $Documents$\_files\_programs\CH010912\LATEST.exe", without the quotes. since there's no spaces, you SHOULDN'T need them, and I have had problems before where having quotes stopped the code from working.

Posted by member 32550 on 2003-06-13 09:54:48 link

to use the commandalias everywhere can be called like:
(code for commandalias)
*CommandAlias "$programdir$\games\game1\start.exe" "game1"

(to call this command)
!command game1


but you have to create the commandalias

Posted by member 333 on 2003-06-13 11:18:18 link

or just tie it to a hotkey (assuming you've got hotkey.dll or jkey.dll loaded):
*hotkey WIN G "$programdir$\games\game1\start.exe"

Then just press Winkey and G and you're good to go :)

Just put the hotkey-definition in $PersonalDir$hotkey.rc

Posted by member 27923 on 2003-06-13 14:45:15 link

And you put this in the lsxcommand in the theme docs, right?

Posted by member 32550 on 2003-06-13 16:42:23 link

ahm.... you write in any theme based .rc (prefered $themedir$step.rc) the command alias as I wrote (*commandalias)
and if you want to set this (anywhere like shortcuts, labels, scripts) you write the command (!command name)
thats all.
The only thing is, that the lsxcommand has to be loaded ;)

Posted by member 27923 on 2003-07-14 20:43:19 link

Ok, I just don't get it ;( I've tried the CommandAlias thing but I'm doing something wrong. Can you please guide me like a baby on what to do ;\

Posted by member 45783 on 2003-07-15 04:30:47 link

What I am seeing here is that some people here type the dirs like "$programdir$\games\game1\start.exe". I don't know how relevant this is, but I recall that you shouldn't put a backslash immediately after an evar. At least if the evar is LS-created and includes the slash itself (most do).

If I remember right, the above would resolve into something like "c:\Program Files\\sumthin"(?), which shouldn't work at all, and the correct would be "$ProgramDir$games\game1\start.exe".

Posted by member 37809 on 2003-07-17 00:21:58 link

lsdocs, _foug.

$Documents$ is a predefined evar to the My Documents CLSID.

$Documents$ for me is ::{450D8FBA-AD25-11D0-98A8-0800361B1103}

Try a literal path instead. Also try the alias without the exclamation mark (guess: possibly ambiguity).