Within GitBash, is there a way to open programs similar to the way you can type the program name in Mac and it runs? For instance, typing 'Sublime' into GitBash on a Mac will open up a Sublime window. I'd like to be able to do that on a pc... 'run', 'open', 'runas', all don't work. Thankyou.
2 Answers
Here's how to set this up for Windows using Git Bash. FYI some of my translations might be off as I'm using a Dutch version of Windows:
- Right-click "My Computer"
- "Properties"
- "Advanced Systems Settings"
- "Environment Variables"
- Locate the Path variable
- Add the path of the folder where the executable of the program you want to launch can be found at the end, separate each path with a ";"
- Restart Git Bash
- Now typing the name of the executable without the extension will launch the programme
- I find it easiest here to add an alias to your .bash_profile file as some executables have weird names (Microsoft Office Package for example). You can do this through the command line as well.
Comments
If running the application from command line is a requirement, then
Option 1 - Include in path the directory where the application is stored
Option 2 - See the contents of "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" and include the applications you need. You can start they form windows run dialog (Win + R) giving its name, or from command line with start appName
There are more options, but all of them require coding or installation of third party programs.