confOS/windows/fix_mihoyo_shortcut.bat

42 lines
1.6 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"
2024-12-09 08:38:53 +01:00
FOR /F "usebackq delims=" %%i IN (`dir /B /S "!collapse!\current"`) DO SET "vbc=%%i"
2024-04-18 01:34:33 +02:00
SET "iconpath=Assets\Images\GameIcon"
2024-07-29 15:10:49 +02:00
SET "shortcutpath=%APPDATA%\Microsoft\Windows\Start Menu\Programs"
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;" ^
2024-07-29 15:10:49 +02:00
"$Shortcut = $WshShell.CreateShortcut('!shortcutpath!\Genshin Impact.lnk');" ^
2024-04-18 01:34:33 +02:00
"$Shortcut.TargetPath = '!collapse!\!exe!';" ^
2024-04-18 16:46:57 +02:00
"$Shortcut.Arguments = 'open --game 1 --region 0 --play';" ^
2024-04-18 01:34:33 +02:00
"$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-07-29 15:10:49 +02:00
"$Shortcut = $WshShell.CreateShortcut('!shortcutpath!\Honkai Star Rail - HSR.lnk');" ^
2024-04-18 01:34:33 +02:00
"$Shortcut.TargetPath = '!collapse!\!exe!';" ^
2024-04-18 16:46:57 +02:00
"$Shortcut.Arguments = 'open --game 2 --region 0 --play';" ^
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()"
2024-07-16 18:45:23 +02:00
:: ZZZ shortcut
ECHO ZZZ shortcut creation...
PowerShell -Command "" ^
"$WshShell = New-Object -comObject WScript.Shell;" ^
2024-07-29 15:10:49 +02:00
"$Shortcut = $WshShell.CreateShortcut('!shortcutpath!\Zenless Zone Zero - ZZZ.lnk');" ^
2024-07-16 18:45:23 +02:00
"$Shortcut.TargetPath = '!collapse!\!exe!';" ^
"$Shortcut.Arguments = 'open --game 3 --region 0 --play';" ^
"$Shortcut.IconLocation = '!vbc!\!iconpath!\icon-zenless.ico';" ^
"$Shortcut.Save()"
2024-04-18 01:18:07 +02:00
IF NOT "%1"=="yes" PAUSE
EXIT /B