Share this page 

Detect if running in a VM Tag(s): Misc Prog HowTo


Using WMIC.
@echo off
wmic bios list full | find /i "vmware"
set result=%ERRORLEVEL%
if "%result%"=="1" echo "not running in a VM"
if "%result%"=="0" echo "running in a VM"
/i is to make the find operation case-insensitive.