Last active
March 14, 2024 02:26
-
-
Save leonelsr/cde77574519eb1fd672bc9690e01257e to your computer and use it in GitHub Desktop.
Run bash (Windows Subsystem for Linux) in background, in order to keep background processes running in WSL
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
' Windows Devs said on the developer feedback asking for cron, deamons and background tasks: | |
' "This first release of Bash/WSL doesn’t support background tasks, cron jobs, daemons, etc. | |
' Currently, when you close your last bash shell console window, we tear-down the Linux process | |
' chain in order to conserve resources." | |
' | |
' That's the workaround for now. | |
' You can run it on boot, for example, and it'll keep a instance of bash running alone in the background | |
' allowing background processes to run on WSL. | |
Set WshShell = CreateObject("WScript.Shell") | |
WshShell.Run chr(34) & "bash" & Chr(34), 0 | |
Set WshShell = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment