I'm trying to make a vbscript that silently starts wsl for me.
This is what I have now:
Dim WinScriptHost
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "wsl -u root service dbus start" & Chr(34), 0
Set WinScriptHost = Nothing
If instead of a command with arguments, I just want to run a single executable (so only one word within the quotes) this structure works, but the above gives me The system cannot find the file specified at line 3. I'm guessing it's trying to execute and executable that's called the whole thing, instead of executing wsl and passing the parameters.
I tried using variable amount of quotes here and there, dropping the Chr(34) in favour of even more quotes etc, but nothing worked. How do I fix this?
Chr(34)is completely unnecessary. If the commandwslis not being found check thePATHenvironment variable or just try running the command from a command prompt to see if you get the same error as running it with VBScript.