Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- net session >nul 2>&1 || (PowerShell start -verb runas '%~0' &exit /b)
- chcp 65001 >NUL 2>&1
- FOR /F "usebackq delims=" %%i in (`
- powershell -command "(Get-CimInstance -class Win32_computersystem).Manufacturer"
- `) DO SET _machinetype=%%i
- IF %_machinetype% == "Virtual Machine" GOTO :VM ELSE
- IF %_machinetype% == "VMware, Inc." GOTO :VM ELSE
- IF %_machinetype% == "VirtualBox" GOTO :VM ELSE
- IF %_machinetype% == "Xen" GOTO :VM ELSE
- ECHO C'est une machine physique
- pause
- GOTO :EOF
- :VM
- ECHO C'est une machine virtuelle
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement