aboutsummaryrefslogtreecommitdiff
path: root/examples/dpp-example-cplusplus.bat
blob: d19d3bfc7a78b5751ca314f96c868d4c904b8995 (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=DPP-Example-CPlusPlus
set DRIVER="%~dp0\dpp-example-cplusplus.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