Based on: How to create a shortcut using a batch script?
I can't figure out how to write this batch so all the quotes are in the right place and create the shortcut file. I used the above info as reference. My final target should be
Target: %COMSPEC% /c start "" "E:\PinballEmporium\Core\RetroFE.exe"
This is the batch I've wrote, if I remove everything after the word 'start' it will write the shortcut file, but obviously that's not all I need. (This is being launched from 'E:\PinballEmporium')
@echo off
set SCRIPT="%TEMP%%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\Pinball Emporium.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
REM %COMSPEC% /c start "" "E:\PinballEmporium\Core\RetroFE.exe"
echo oLink.TargetPath = "%%COMSPEC%% /c start "" "%cd%\Core\RetroFE.exe"" >> %SCRIPT%
REM echo oLink.Arguments="%cd%\Core\RetroFE.exe" >> %SCRIPT%
echo oLink.IconLocation="%cd%\PEICON.ico" >> %SCRIPT%
echo oLink.WorkingDirectory="%cd%" >> %SCRIPT%
echo oLink.WindowStyle="0" >> %SCRIPT%
echo oLink.Description="Shortcut for Pinball Emporium"
echo oLink.Save >> %SCRIPT%
cscript /nologo %SCRIPT%
del %SCRIPT%