本帖最后由 77七 于 2023-1-17 00:15 编辑
- @echo off
- setlocal enabledelayedexpansion
- cd /d "D:\VMware\"
- set /a n=0
- for /f "tokens=2,4 delims=\." %%a in ('vmrun list ^| findstr vmx') do (
- if /i "%%a" equ "vos" (
- set /a n=n+1
- if !n! equ 1 (
- set firstNum=%%b
- )
- if !n! equ 5 (
- set fifthNum=%%b
- )
- )
- )
- if not defined fifthNum (
- goto :eof
- )
- set /a m=%fifthNum%%%5
- if %m% neq 0 (
- vmrun stop "D:\vos\%firstNum%\%firstNum%.vmx" hard
- ping 127.0.0.1 -n 6 >nul
- )
- endlocal
- exit
复制代码 00:15已修改,小改一下,试试能不能行 |