executing programs from command line

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
lvcgpro
Junior Member
Junior Member
Posts: 11
Joined: 2006-04-25, 22:12 UTC

executing programs from command line

Post by *lvcgpro »

I'm a total commander noob. What I'm trying to do is to make it possible to run a program (visual foxpro e.g.) by just typing a single letter (e.g. "v") and hitting enter on the command line. I can do it within the directory that the batch file is in (of course), but I want to be able to do that in any directory. I know it can be done - and I'm sure it's not hard. I think it has to do with writing a batch file (which I've done) and have an environment variable point to it - but I could be WAY off - can someone help?
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

1. open

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
if you want to create an alias for all users;

Code: Select all

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths
if you want to create an alias for the current user only;

2. create key

Code: Select all

v.exe
;

3. enter full path to your visualpro.exe in default value of that key.

This is Windows standard behaviour, so it will also work for Start-Run, etc..., not only in TC.

Of course you can also create a batch like "v.cmd" or "v.bat" and put it into a path covered by the %path% variable, for example in your windows directory.

The content should look like that:
1.

Code: Select all

start X:\blabla.exe
if path to the exe has no spaces;
2.

Code: Select all

start "" "X:\bla bla.exe"
if path contains spaces (also works with no spaces of course)

Alternatives are specialized program starters like TypeAndRun, Easy-Go! or the excellent AutoHotkey with which you can create aliases much more comfortable.

Icfu
Last edited by icfu on 2006-04-25, 23:39 UTC, edited 1 time in total.
This account is for sale
User avatar
petergus
Member
Member
Posts: 164
Joined: 2003-02-06, 16:28 UTC
Location: Sweden, Enköping
Contact:

Re: total commander noob...help

Post by *petergus »

lvcgpro wrote:Like i said - i'm a total commander noob. What I'm trying to do is to make it possible to run a program (visual foxpro e.g.) by just typing a single letter (e.g. "v") and hitting enter on the command line. I know it can be done - and I'm sure it's not hard. I think it has to do with writing a batch file (which I've done) and have an environment variable point to it - but I could be WAY off - can someone help? Hope i haven't confused ya too much.
Hi, the simplest way is to create a shortcut to your program and place it in your Windows or System32 folder.

No need to edit registry or create a batchfile. Just make sure the name is unique.

To create a shortcut with TC you use CTRL-SHIFT-F5.

// Peter
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

This is way too banal. Try again, please. ;)

Icfu
This account is for sale
lvcgpro
Junior Member
Junior Member
Posts: 11
Joined: 2006-04-25, 22:12 UTC

Post by *lvcgpro »

thanks icfu - quick and easy - i just copied my batch file into an already existant path that was in the environment variables. (I was originally trying to create my own) - I appreciate the help!
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Here you have some more options, including those proposed by me and petergus:
http://www.virtualplastic.net/html/misc_cut.html

Excellent site to visit, not only that link. ;)

Icfu
This account is for sale
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

batch will always jump infront off you without adequate 3td party tools. So, the only good solution is either a shortcut or Registry.
Habemus majkam!
Post Reply