I'm trying to create a script that will create shortcuts of the target batch files and set the icon to a .ico or .dll icon file:
@echo off
@echo Writing CreateShortcut script
@echo Set oWS = WScript.CreateObject("WScript.Shell") >> CreateShortcut.vbs
@echo sLinkFile = "C:\rustserver\Batch Files\rustserver\launcher\Test1.lnk" >> CreateShortcut.vbs
@echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs
@echo oLink.TargetPath = "C:\rustserver\Batch Files\Test1.bat" >> CreateShortcut.vbs
@echo oLink.Save >> CreateShortcut.vbs
pause
@echo Writing EditShortcut script
@echo Set iWS = WScript.CreateObject("Shell.Application") >> EditShortcut.vbs
@echo sIconFile.IconLocation "C:\rustserver\Batch Files\rustserver\launcher\Icons\CompilerIcon.ico",0 >> EditShortcut.vbs
@echo Set oIcon = iWS.EditShortcut(sIconFile) >> EditShortcut.vbs
@echo oIcon.TargetPath = "C:\rustserver\Batch Files\rustserver\launcher\Test1.lnk" >> EditShortcut.vbs
@echo oIcon.Save >> EditShortcut.vbs
pause
@echo Running .vbs scripts...
cscript CreateShortcut.vbs
cscript EditShortcut.vbs
pause
@echo Deleting .vbs scripts...
del CreateShortcut.vbs
del EditShortcut.vbs
pause
@echo Deleting test shortcuts...
del Test1.lnk
pause
Converting the .bat files to .exe isn't an option because there are a few values that need to be reconfigured between each batch file.
Like I can get the script to create the shortcuts of the batch files just fine but no matter what I try I can't get the script to set the icon of the shortcut...