EN
Windows - open file using Bash (via File Explorer)
3
points
This article, will show you how to open files via File Explorer using Bash on Windows.
Quick solution:
'C:/Windows/explorer.exe' /path/to/file
Reusable solution
In this section, you can find how create reusable alias and use it to open indicated files via File Explorer using Bash.
Simple steps:
- go to user home directory,
e.g. under Bash run the command:cd ~
%homedrive%%homepath%
- add to
.bash_profile
file the following line:alias explorer='C:/Windows/explorer.exe'
- re-run Bash or run in existing Bash
source ~/.bash_profile
command,
- from now, you can open any file using
explorer
command, e.g.:explorer /path/to/file
Practical example: