Created
January 1, 2026 19:33
-
-
Save naranyala/3c634394ed3f9409c13ab2041bd8153a to your computer and use it in GitHub Desktop.
expose every windows system executable for "git bash" on windows machine
This file contains hidden or 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 | |
| # Script to expose Windows executables in Git Bash with progress indicator | |
| WIN_DIRS=( | |
| "/c/Windows" | |
| "/c/Windows/System32" | |
| "/c/Windows/SysWOW64" | |
| "/c/Program Files" | |
| "/c/Program Files (x86)" | |
| ) | |
| TMP_FILE=$(mktemp) | |
| mkdir -p ~/bin | |
| echo "🔍 Scanning for executables..." | |
| for dir in "${WIN_DIRS[@]}"; do | |
| if [ -d "$dir" ]; then | |
| echo "➡️ Searching in $dir ..." | |
| find "$dir" -maxdepth 2 -type f -iname "*.exe" >> "$TMP_FILE" | |
| fi | |
| done | |
| TOTAL=$(wc -l < "$TMP_FILE") | |
| COUNT=0 | |
| echo "⚙️ Creating symlinks in ~/bin ..." | |
| while IFS= read -r exe; do | |
| COUNT=$((COUNT+1)) | |
| exe_name=$(basename "$exe") | |
| link_name="${exe_name%.exe}" | |
| ln -sf "$exe" "$HOME/bin/$link_name" | |
| # Simple progress indicator every 100 files | |
| if (( COUNT % 100 == 0 )); then | |
| echo "Processed $COUNT / $TOTAL executables..." | |
| fi | |
| done < "$TMP_FILE" | |
| rm "$TMP_FILE" | |
| echo "✅ Done! $COUNT executables exposed." | |
| echo "➡️ Restart Git Bash or run: source ~/.bashrc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment