My goal is to have a batch script that whenever launched if the machine is connected to my home wifi (SSID = The Sanctum Sanctorum - 5GHz) will launch Kodi from one folder ("C:\Program Files (x86)\Kodi at Home") but otherwise will launch Kodi from another ("C:\Program Files (x86)\Kodi").
Any help is much appreciated and thanks for your time I have attached updates with my code progress!
Edit #3 - Thanks to @treintje
Code Attempt #3
@echo off
set "ssid=The Sanctum Sanctorum - 5GHz"
netsh wlan show interfaces | findstr /r /c:"^ *SSID *: %ssid%$" 1>nul
if %errorlevel% equ 0 (
set "kodi=Kodi at Home\Kodi.exe" "-p"
) else (
set "kodi=Kodi\Kodi.exe"
)
"%programfiles(x86)%\%kodi%"
Now it seems even when connected to the specified network it always launches the "kodi=Kodi\Kodi.exe" version. I bet it's just a tiny syntax error I don't know to see as I'm sure treintje is right this is the way to do it!