Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- ChCp 1251 >nul
- cd /d "%~dp0"
- call :SetupLinkTo
- for /f "eol=; tokens=2* delims=:, " %%a in ('type "%cd%\Launcher\launcher-settings.json"^|find "version"') do set version=%%a
- set version=%version:"=%
- rem call :LinkTest "%userprofile%\Desktop\Cities Skylines II.lnk" "%cd%\Cities 2.exe" "" "%cd%\Cities2.exe" "%cd%\test 2" "Cities: Skylines II %version%"
- LinkTo.vbs "%userprofile%\Desktop\Cities Skylines II.lnk" "%cd%\Cities2.exe" "" "%cd%\Cities2.exe" "%cd%\" "Cities: Skylines II (%version%)"
- exit
- :SetupLinkTo
- set CreateLinkTo="%userprofile%\AppData\Local\Microsoft\WindowsApps\LinkTo.vbs"
- rem if not exist %CreateLinkTo% call :CreateLinkTo > %CreateLinkTo%
- call :CreateLinkTo > %CreateLinkTo%
- goto :EOF
- :LinkTest
- echo. CreateShortcut %1
- echo. TargetPath %2
- echo. Arguments %3
- echo. IconLocation %4
- echo. WorkingDir %5
- echo. Description %6
- pause
- goto :EOF
- :CreateLinkTo
- @echo off
- echo On Error resume next
- echo if WScript.Arguments.Count ^< 2 then
- echo WScript.Echo "Command line:" ^& VbCrLf ^& "LnkTo.vbs CreateShortcut TargetPath Arguments IconLocation WorkingDirectory Description"
- echo WScript.Quit 1
- echo end if
- echo Set oWS = WScript.CreateObject^("WScript.Shell")
- echo Set oLink = oWS.CreateShortcut(Wscript.Arguments(0))
- echo oLink.TargetPath = Wscript.Arguments(1)
- echo if WScript.Arguments.Count ^> 2 Then oLink.Arguments = Wscript.Arguments(2) ' Аргументы командной строки
- echo if WScript.Arguments.Count ^> 3 Then oLink.IconLocation = Wscript.Arguments(3) ' Путь к файлу иконки для ярлыка
- echo if WScript.Arguments.Count ^> 4 Then oLink.WorkingDirectory = Wscript.Arguments(4) ' Рабочая папка
- echo if WScript.Arguments.Count ^> 5 Then oLink.Description = Wscript.Arguments(5) ' Комментарий
- rem if WScript.Arguments.Count ^> 6 Then oLink.Hotkey = Wscript.Arguments(6) ' Клавиши быстрого вызова "CTRL+SHIFT+F"
- rem if WScript.Arguments.Count ^> 7 Then oLink.WindowStyle = Wscript.Arguments(7) ' Стиль окна: 1-Обычное; 3-Развёрнутое; 7-Свёрнутое
- echo oLink.Save
- goto :EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement