@echo off
echo Administrative permissions required. Detecting permissions...

net session >nul 2>&1
if %errorLevel% == 0 (
	echo Success: Administrative permissions confirmed.
	goto work
) else (
	echo Failure: Current permissions inadequate.
	pause
	exit
)

:work
echo.
echo.
call %SYSTEMROOT%\System32\certutil.exe -f -addstore "Root" "%~dp0\myDrivers.cer"

if %errorLevel% == 0 (
	echo.
	echo Success: Certification installed succesfully!
	echo.
	echo.
	call %SYSTEMROOT%\System32\certutil.exe -f -addstore "TrustedPublisher" "%~dp0\myDrivers.cer"
	
	if %errorLevel% == 0 (
		echo.
		echo Success: Certification installed succesfully!
	) else (
		echo Failure: Couldn't install the certificate.
	)
) else (
	echo Failure: Couldn't install the certificate.
)

pause
exit