aboutsummaryrefslogtreecommitdiff
path: root/ht.bat
blob: de53f78de534593c7387eda1d0b6d2fd125546ee (plain)
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
@echo off
set SERVICE_NAME=ht
set DRIVER="%~dp0\ht.sys"

net session >nul 2>&1
if NOT %ERRORLEVEL% EQU 0 (
    echo ERROR: This script requires Administrator privileges!
    pause
    exit /b 1
)

echo ---------------------------------------
echo -- Service Name: %SERVICE_NAME%
echo -- Driver......: %DRIVER%
echo ---------------------------------------

sc create %SERVICE_NAME% binPath= %DRIVER% type= kernel
echo ---------------------------------------
sc start %SERVICE_NAME%
echo ---------------------------------------
sc query %SERVICE_NAME%
echo [PRESS A KEY TO STOP THE DRIVER]
pause
sc stop %SERVICE_NAME%
sc delete %SERVICE_NAME%
echo Done.
timeout /t 3