11

Is there an easy way in windows to set a given string, like "sidb" to run a program or open a given folder in Windows?

My original idea was to be able to run commands like that in the "Execute" start button menu (or Win + R),so I'd just have to do WIN+R and type "sidb".

What is the best way to accomplish this?

EDIT: May I rephrase this as : Is there a way to define for example, in systems variables, sibd="C:.......blabla\ and then I'd just have to type "sibd" in Run?

1
  • Maybe you should almost upvote the answer that tells you that Windows has the feature you're looking for out of the box. Mar 18, 2013 at 15:27

10 Answers 10

17

You can make small batch files which execute the program, and name them after the desired alias. Then simply put them into a folder that's in your path environment variable.

example, ff.cmd:

@echo off
"C:\Program Files\Mozilla Firefox\Firefox.exe"
3
  • As your answer is marked as correct and it's the most highlighted, it could be a good idea to add to it what @Maslow says, because Windows has the feature that devouredelysium is looking for already implemented. Mar 18, 2013 at 15:31
  • Is there a way to do this and pass the command line arguments?
    – tmsimont
    Mar 16, 2015 at 14:26
  • 1
    @tmsimont: \@echo off "C:\Program Files\Mozilla Firefox\Firefox.exe" %* Jan 22, 2016 at 13:05
9

Surprised on one has mentioned this one

http://weblogs.asp.net/whaggard/archive/2004/04/11/111232.aspx

It concerns adding registry keys under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths Which is evaluated just after %PATH%

Take note that the reg sub key name would be what you want to type + .exe

so add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\sibd.exe with a default value of C:.......blabla\

it seems much easier(and in some ways safer, others not so much) to granularly manage than the horrendous %PATH% string.

4
  • Surprised is not the word. It's incredible that Windows has the feature that the asker is exactly looking for already implemented, that a answer that offers a workaround and many third-party software-based solution is marked as correct answer, another answer with a bunch of third-party apps gets awarded, and the real answer to the question don't get even the upvote of the original asker... Mar 18, 2013 at 15:26
  • By the way, if you'd like to add it to your answer... for those which don't like to manually edit the registry, there's a little app which does it for you. Mar 18, 2013 at 15:35
  • I knew there was another alternative, I've finally found it: WinR Alias Manager Mar 18, 2013 at 16:03
  • Incredible so many years using batch and Command CMD 4DOS nDOS BE , never ever stumbled upon this and its so freakin useful, THANK YOU
    – arana
    Nov 9, 2023 at 23:19
7

If all you want to do is run program or open folders, you can make a batch file to do that. As long as that batch file is in the PATH (and doesn't conflict in name) it will be run by any command prompt.

notepad example:
make a batch file to open notepad called np.bat In the batch file write
START %windir%\system32\notepad.exe

C drive example:
make a batch file to open the c drive called c.bat In the batch file write
START explorer C:\

There are also third party apps: SlickRun, MagicWords, Launchy, slimKEYS, Enso Launcher, Colibri

3
+25

You can use a free program launcher.

See this article for a discussion of some the best : Best Free Program Launcher, which contains info about Launchy, Find and Run Robot, Enso, Slickrun, FSL Launcher, Fast Launcher, 8Start, and more.

3
  • Erm..there were already several answers regarding this tool. Jan 22, 2011 at 17:14
  • Yes, I saw the reference to SlickRun, but there are quite a lot of others cited above that were not mentioned. If you don't like it, then I took it out.
    – harrymc
    Jan 22, 2011 at 18:08
  • I second Launchy. I probably execute about 20-30 commands a day using it. Big plus, is it pops to the center of the screen so you don't have to divert your eyes from last/next task.
    – Rolnik
    Jan 28, 2011 at 16:50
1

I use a path, C:\bin, which I put into the system PATH variable. I put things like GNU utils, SysInternals, and shortcuts to frequently used programs here. For example, a short to notepad++ called np. Winkey+R, np, enter. Done.

1

I wonder why nobody mentioned MKLINK. It's available in Vista and 7 and allows to make symlinks for files AND folders.

Syntax:

mklink "c:\SymlinkFile" "c:\windows\realFile"

Easy.

1
  • Very helpful, I'd give more +1 points if I could. Batch files kinda suck in that the Ctrl+C signal goes to the batch file executor rather than the program actually running. (Which I guess makes sense in some cases but not if you're just using an alias.)
    – Jason S
    Mar 22, 2013 at 23:08
1

You could use Colibri - Leet Speak, although it's not being updated any more, the source from GitHub.

The starting configuration isn't great, but if you edit the SQLLite databases and change it to a single path you can drop links, files, batches there and execute them by simply pressing Ctrl+Space, then typing in some of the characters of it's name.

e.g. start Firefox: Ctrl+Space type in ff enter

It also allows to add arguments by pressing tab and then enter them, e.g. type in ipconfig /all

Takes some work to set it up though.

0

Have you considered a program like slickrun? It is very lightweight and useful; allowing you to map key strokes to commands as well as setting up short aliases for commands.

I would highly recommend it for the type of usage you're describing. There are other alternatives that do similar things, but it looks like maintenance and improvements to slickrun are now being done by the fine folks who brought us fiddler2.

Alternatives can be found at alternativeto.net, and elsewhere using google.

0

The fastest way I think you could run programs is either by hotkey or by just typing it.

For hotkey purposes, you have Qliner Hotkeys.

For just typing it without pressing any prior/subsequent key, you have PhaseExpress.

Examples of PhaseExpress:

Visit SuperUser? runSU. Play StarCraft II? runSC2.

I add run because it doesn't interfere when typing SU here or SC2 on Gaming websites or in-game, but it's fully customizable and you can also choose to launch only by pressing a subsequent key. It also allows you to do text substitution, which can speed up things a lot...

Link to PhaseExpress? linkPE types [PhaseExpress](http://www.phraseexpress.com/).

0

Made an simple CLI Framework for this. http://code.google.com/p/syswin32/downloads/list

Based on sqlite, give it a try.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .