- @echo off
- setlocal enabledelayedexpansion
- cd /d "D:\VMware\"
- for /f "tokens=4 delims=\." %%a in ('vmrun list ^| find vmx') do (
- set _"%%a"=ture
- )
-
- for /l %%i in (1,5,120) do (
- set num=%%i
- set /a m=1
- set /a num1=num,num2=num+1,num3=num+2,num4=num+3,num5=num+4
- for %%b in (!num1! !num2! !num3! !num4! !num5!) do (
- if not defined _"%%b" (
- if !m! equ 1 (
- set /a m=2
- for %%c in (!num1! !num2! !num3! !num4! !num5!) do (
- if defined _"%%c" (
- vmrun stop "D:\vos\%%c\%%c.vmx" hard
- echo 关闭了虚拟机,编号%%c
- )
- )
- )
- )
- )
- )
- endlocal
- pause
- exit
复制代码
试试能行不,我是新手,不会写,如果不行,等大神帮你写 |