-
Notifications
You must be signed in to change notification settings - Fork 0
/
Steam_Installer.bat
30 lines (22 loc) · 1.29 KB
/
Steam_Installer.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@echo off
::Script to force run as Admin
set "params=%*"
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
setlocal enabledelayedexpansion
set "inputfile=%~dp0Steam\TaskScheduler_Template_DoNotTouch.xml"
set "outputfile=%~dp0temp.xml"
set "searchString=<Arguments>WindowsExplorer.vbs</Arguments>"
set "replaceString=<Arguments>%~dp0Steam\WindowsExplorer.vbs</Arguments>"
if exist "%outputfile%" del "%outputfile%"
for /f "delims=" %%i in ('type "%inputfile%"') do (
set "line=%%i"
set "modifiedLine=!line:%searchString%=%replaceString%!"
echo !modifiedLine! >> "%outputfile%"
)
:: Add Script to replace Playnite as shell
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "wscript.exe %~dp0Steam\LauncherStartup.vbs" /f
:: Add Task Scheduler to start explorer.exe
schtasks /query /TN "Game Launcher Shell" >NUL 2>&1 && schtasks /delete /tn "Game Launcher Startup" /f & schtasks /create /tn "Game Launcher Shell" /xml %~dp0temp.xml
del "%outputfile%"
timeout /t 3
exit