Created
June 13, 2013 12:00
-
-
Save kranthilakum/5773142 to your computer and use it in GitHub Desktop.
Open windows explorer anywhere. To open current working directory use < start . > or < explorer . > in cygwin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
# author: Robert Mark Bram | |
# link: http://robertmarkbramprogrammer.blogspot.se/2007/06/cygwin-bash-script-open-windows.html | |
usage () | |
{ | |
echo "Open Windows Explorer" | |
echo "Usage: $0 [-help] [path]" | |
echo " [path]: folder at which to open Windows Explorer, will" | |
echo " default to current dir if not supplied." | |
echo " [-help] Display help (this message)." | |
} | |
location=. | |
case "$1" in | |
"" ) location=.;; | |
"-help" ) usage; exit 0;; | |
* ) location="${1}";; | |
esac | |
if [ -e "$location" ] | |
then | |
WIN_PATH=`cygpath -w -a "${location}"` | |
cmd /C start "" "$WIN_PATH" | |
else | |
echo ${location} does not exist! | |
exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment