confOS/windows/fix_mihoyo_shortcut.bat

31 lines
1.1 KiB
Batchfile
Raw Normal View History

2024-04-18 01:18:07 +02:00
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET "collapse=%ProgramFiles%\Collapse Launcher"
2024-04-18 01:34:33 +02:00
SET "exe=CollapseLauncher.exe"
FOR /F "usebackq delims=" %%i IN (`dir /B /S "!collapse!\app-*"`) DO SET "vbc=%%i"
SET "iconpath=Assets\Images\GameIcon"
2024-04-18 01:18:07 +02:00
:: Genshin shortcut
2024-04-18 01:34:33 +02:00
ECHO Genshin shortcut creation...
2024-04-18 01:18:07 +02:00
PowerShell -Command "" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Genshin Impact.lnk');" ^
2024-04-18 01:34:33 +02:00
"$Shortcut.TargetPath = '!collapse!\!exe!';" ^
"$Shortcut.Arguments = 'open -g 1 -r 0';" ^
"$Shortcut.IconLocation = '!vbc!\!iconpath!\icon-genshin.ico';" ^
2024-04-18 01:18:07 +02:00
"$Shortcut.Save()"
:: Honkai shortcut
2024-04-18 01:34:33 +02:00
ECHO Honkai shortcut creation...
2024-04-18 01:18:07 +02:00
PowerShell -Command "" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^
2024-04-18 01:34:33 +02:00
"$Shortcut = $WshShell.CreateShortcut('%APPDATA%\Microsoft\Windows\Start Menu\Programs\Honkai Star Rail.lnk');" ^
"$Shortcut.TargetPath = '!collapse!\!exe!';" ^
"$Shortcut.Arguments = 'open -g 2 -r 0';" ^
2024-04-18 01:35:18 +02:00
"$Shortcut.IconLocation = '!vbc!\!iconpath!\icon-starrail.ico';" ^
2024-04-18 01:18:07 +02:00
"$Shortcut.Save()"
IF NOT "%1"=="yes" PAUSE
EXIT /B