I have a problem with adding already installed program as available command in windows cmd. For example I installed new text Geany and want to open text file using this command:

geany myfile.txt 

I looked over the internet but couldn't find solution for this. I see that windows will execute programs that are added to PATHS like C:/Windows or C:/Windows/System32. I tried adding Shortcut to geany executable but this doesn't work, it doesn't execute shortcuts

Any help on this appreciated


You need to add geany.exe to the path in Windows.

You can get the full path to geany.exe by right clicking the shortcut and selecting the entire Target

  • right click my computer
  • click Properties
  • click Advanced System Settings
  • click Environment Variables
  • In the bottom pane find Path, select it and click Edit
  • after the last ;, add the full path to the folder containing geany.exe (in this case you must add C:\Program Files (x86)\Geany\bin\, also note the \ at the end)

Now you should be able to launch geany from the command line, or from Start\Run

PS: Make sure to restart the CMD application before trying it out. You will need to open a new CMD window after the changes have been made.

  • thanks Keltari, i have done this but still doesn't work. I will re-start computer and see if that helps – user3109173 Dec 16 '13 at 23:38
  • be sure to quote the string if their are spaces in the path – Keltari Dec 16 '13 at 23:44
  • 2
    One thing to add to this: you 'might' need to reboot the computer or at the very least log off, then on again for the new path variable to be updated (I say 'might' because experience has shown that sometimes the new path variable doesn't get recognized until a login/reboot) ... side note: i have a C:\custom_cmds\ that is in my path variable that I then just drop shortcut's (named the same as the application) into. This has an added advantage of never needing to modify PATH again or messing with config files of certain programs (just as an anecdote) – txtechhelp Dec 17 '13 at 0:10
  • 3
    Just encountered the same issue. Everything the above poster said is true except you should add the entire bin folder to your PATH variable. For me it was C:\Program Files (x86)\Geany\bin – user294172 Jan 29 '14 at 0:43
  • 3
    (1) @RasmusLarsen: "User variables" apply to your account only; "System Variables" apply to all users. (2) You do not need to include a \ at the end of the names of folders.  (3) In the Environment Variables window, you do not use quotes — not even for folder names that contain spaces. – Scott Nov 12 '17 at 4:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.