Advertisement
rc-chuah

GetHyperVStatus

Jun 13th, 2022
1,088
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.40 KB | None | 0 0
  1. @ECHO OFF
  2. SETLOCAL EnableDelayedExpansion
  3. for /f "tokens=*" %%G in ('bcdedit /enum {default} ^| find /I "hypervisorlaunchtype"') do set HYPERVSTATUS=%%G
  4. IF /I "%HYPERVSTATUS%" == "hypervisorlaunchtype    auto" (
  5.     ECHO hypervisorlaunchtype    Auto
  6. ) ELSE IF /I "%HYPERVSTATUS%" == "hypervisorlaunchtype    off" (
  7.     ECHO hypervisorlaunchtype    Off
  8. ) ELSE (
  9.     ECHO Unknown Hyper-V Status
  10. )
  11. PAUSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement