Let's try creating a shortcut for launching GNU Octave from the Windows taskbar. Ubuntu 18.04 is used for this example and all script files are assumed to be stored in 'C:\wsl' folder.
STEP 1 Install GNU Octave
sudo apt install octave
STEP 2 Create a batch file for launching the newly installed GNU Octave
REM *** Start X410 in Windowed Apps mode. If X410 is already running in Desktop mode,
REM *** it'll be silently terminated and restarted in Windowed Apps mode.
REM *** Start GNU Octave
ubuntu1804.exe run "export DISPLAY=127.0.0.1:0.0; octave&"
STEP 3 Create a VBScript file for executing a batch file without any flashing Console window
Windows always shows a Command Prompt window when executing a batch file; we couldn't find a way to completely hide it. By using this VBScript, we can silently run the batch file.
If WScript.Arguments.Count <= 0 Then
bat = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")) & WScript.Arguments(0) & ".bat"
arg = ""
If WScript.Arguments.Count > 1 Then
arg = WScript.Arguments(1)
CreateObject("WScript.Shell").Run """" & bat & """ """ & arg & """", 0, False
STEP 4 Create a shortcut for launching the batch file from Step 2 using the VBScript from Step 3
Set the target of the shortcut to:
wscript.exe "C:\wsl\bat-launcher.vbs" "start-octave"
STEP 5 You can now select 'Pin to taskbar' or 'Pin to Start' from the right-click popup menu