-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReset-NGC.bat
More file actions
73 lines (59 loc) · 1.5 KB
/
Reset-NGC.bat
File metadata and controls
73 lines (59 loc) · 1.5 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@echo off
title Reset NGC Folder Tool
set "NGC=C:\Windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\Ngc"
:: ===== Check for Admin Rights =====
net session >nul 2>&1
if %errorLevel% NEQ 0 (
echo Requesting Administrator privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
echo.
echo Running with Administrator privileges...
echo.
:: ===== Check if Folder Exists =====
if not exist "%NGC%" (
echo NGC folder not found.
echo Nothing to reset.
pause
exit /b
)
echo WARNING:
echo This will remove Windows Hello PIN and biometric data.
echo.
choice /m "Continue?"
if %errorlevel%==2 exit /b
echo.
echo Stopping Windows Biometric Service...
net stop WbioSrvc >nul 2>&1
echo Taking ownership...
takeown /f "%NGC%" /r /d y >nul
echo Granting permissions...
icacls "%NGC%" /grant administrators:F /t >nul
echo Removing folder...
rd /s /q "%NGC%"
if exist "%NGC%" (
echo Failed to remove NGC folder.
echo Please reboot and try again.
pause
exit /b
)
echo.
echo Reset completed successfully.
echo.
:: ===== Restart Biometric Service =====
echo Starting Windows Biometric Service...
net start WbioSrvc >nul 2>&1
if %errorlevel%==0 (
echo Windows Biometric Service started successfully.
) else (
echo Failed to start Windows Biometric Service. You may need to start it manually.
)
echo.
choice /m "Reboot now?"
if %errorlevel%==1 (
shutdown /r /t 0
) else (
echo Please reboot manually before setting up Windows Hello again.
pause
)