Skip to content

Instantly share code, notes, and snippets.

@leonelsr
leonelsr / bash_background.vbs
Last active March 14, 2024 02:26
Run bash (Windows Subsystem for Linux) in background, in order to keep background processes running in WSL
' 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")