systeminfo
,如果它显示类似于“制造商: VMware, Inc.”而不是 Microsoft Windows,则可以确定 setup_ 是否是虚拟的。
@echo off
systeminfo > temp.txt
findstr /e "System Model: Virtual Machine" temp.txt
del temp.txt
if errorlevel 1 (
echo Physical machine
) else (
echo Virtual machine
)