-
Notifications
You must be signed in to change notification settings - Fork 0
/
novms.bat
39 lines (33 loc) 路 1.63 KB
/
novms.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
38
39
@echo off
set /p response=Do you use virtual machines on this device? (yes/no):
if /i "%response%"=="no" (
echo Checking and disabling virtual machine features...
%SystemRoot%\System32\dism.exe /Online /Get-FeatureInfo /FeatureName:Microsoft-Hyper-V >nul 2>&1
if %errorlevel% equ 0 (
echo Disabling Hyper-V...
%SystemRoot%\System32\dism.exe /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V /NoRestart
)
%SystemRoot%\System32\dism.exe /Online /Get-FeatureInfo /FeatureName:VirtualMachinePlatform >nul 2>&1
if %errorlevel% equ 0 (
echo Disabling Virtual Machine Platform...
%SystemRoot%\System32\dism.exe /Online /Disable-Feature /FeatureName:VirtualMachinePlatform /NoRestart
)
%SystemRoot%\System32\dism.exe /Online /Get-FeatureInfo /FeatureName:HypervisorPlatform >nul 2>&1
if %errorlevel% equ 0 (
echo Disabling Windows Hypervisor Platform...
%SystemRoot%\System32\dism.exe /Online /Disable-Feature /FeatureName:HypervisorPlatform /NoRestart
)
%SystemRoot%\System32\dism.exe /Online /Get-FeatureInfo /FeatureName:Microsoft-Windows-Subsystem-Linux >nul 2>&1
if %errorlevel% equ 0 (
echo Disabling Windows Subsystem for Linux...
%SystemRoot%\System32\dism.exe /Online /Disable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /NoRestart
)
echo All virtual machine features disabled. Moving on....
timeout 2 > nul
start "Disabling power throttling" power.bat
) else (
echo No issues, moving on....
timeout 2 > nul
start "Disabling power throttling" power.bat
exit
)