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
@echo off 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. x410.exe /wm 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 WScript.Quit End If bat = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")) & WScript.Arguments(0) & ".bat" arg = "" If WScript.Arguments.Count > 1 Then arg = WScript.Arguments(1) End If 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"