forked from StormExecute/InputSwitcherX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetPatch.bat
37 lines (27 loc) · 886 Bytes
/
setPatch.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
31
32
33
34
35
36
37
@echo off
cd /d "%~dp0"
Title InputSwitcherX
set systemDll=%windir%\system32\InputSwitch.dll
openfiles > NUL 2>&1
IF %ERRORLEVEL% EQU 0 (
if exist ".\output\InputSwitch.dll" (
takeown /F %systemDll% /A
icacls %systemDll% /grant:r "*S-1-5-32-544":f
taskkill /F /IM explorer.exe
PING -n 2 -w 1000 127.0.0.1 > nul
copy ".\output\InputSwitch.dll" %systemDll% /Y
PING -n 2 -w 1000 127.0.0.1 > nul
start %windir%\explorer.exe
icacls %systemDll% /setowner "NT SERVICE\TrustedInstaller" /C /L /Q
icacls %systemDll% /grant:r "NT SERVICE\TrustedInstaller":rx
icacls %systemDll% /grant:r "*S-1-5-32-544":rx
echo Done!
pause
) else (
echo Copy InputSwitch.dll to output first!
pause
)
) else (
echo Run this patch with admin rights!
pause
)