Last active
July 3, 2024 09:37
-
-
Save cowboy/44b2a2def2ae0a2f1de5c65d67689d23 to your computer and use it in GitHub Desktop.
bash script in a Windows cmd file, so you can double-click and run right from Explorer
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
:<<"::CMDLITERAL" | |
@echo off | |
FOR /F "tokens=* USEBACKQ" %%F IN (`wsl wslpath '%~f0'`) DO ( | |
SET script_path=%%F | |
) | |
bash -c "'%script_path%'" | |
exit /b | |
::CMDLITERAL | |
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) | |
cd "$SCRIPT_DIR" | |
your_bash_code_goes_here |
The Bash code you want to execute should replace the placeholder your_bash_code_goes_here immaculate grid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uses code from
Tested in Windows 11 with WSL 2