@echo off
set errore=0
set level=0

:main
cls
if exist cpuz64.exe ( echo "fonud cpuz"
) else (
    set errore=1
    goto error
)

if exist gpuz.exe ( echo "fonud gpuz"
) else (
    set errore=2
    goto error
)

echo "wait few sec"
cpuz64.exe -txt=%COMPUTERNAME%cpu
gpuz.exe -dump %COMPUTERNAME%gpu.txt
goto gettxt

:gettxt
if not exist %COMPUTERNAME%cpu.txt ( goto gettxt ) 
if not exist %COMPUTERNAME%gpu.txt ( goto gettxt ) else ( goto anal_text)

:anal_text

find /i "vmmare" %COMPUTERNAME%cpu.txt
if %errorlevel% == 1 ( set level=0 ) else ( echo "in vm" && goto res) 

find /i "vmmare" %COMPUTERNAME%gpu.txt
if %errorlevel% == 1 ( set level=0 ) else ( echo "in vm" && goto res) 

echo "not in vm"
goto res




:res
pause
del /q /f %COMPUTERNAME%cpu.txt
del /q /f %COMPUTERNAME%gpu.txt
del /q /f cpuz.ini
exit


:error
if %errore% == 1 ( echo "cpu-z not exist!")
if %errore% == 2 ( echo "gpu-z not exist!")
set errore = 0
pause
goto main