VMware批量启动关闭虚拟机

说明:
1、vmrun -T ws start “/opt/VMware/win2k8r2.vmx” nogui启动无图形界面虚拟机 (-T 是区分宿主机的类型,ws|server|server1|fusion|esx|vc|player,可能比较常用的是ws、esx和player,不过我没有加-T在Workstation也能正常运行, 可能esx和server就需要了)
2、vmrun start “/opt/VMware/win2k8r2.vmx” gui启动带图形界面虚拟机
3、vmrun stop “/opt/VMware/win2k8r2.vmx”hard | soft强制关闭虚拟机(相当于直接关电源) | 正常关闭虚拟机

start.bat

cd D:\Program Files\vm\ D:
vmrun start "D:\Program Files\vms\master01\CentOS.vmx" nogui
vmrun start "D:\Program Files\vms\master02\master02.vmx" nogui
vmrun start "D:\Program Files\vms\master03\master03.vmx" nogui
vmrun start "D:\Program Files\vms\master04\master04.vmx" nogui
vmrun start "D:\Program Files\vms\master05\master05.vmx" nogui
vmrun start "D:\Program Files\vms\master06\master06.vmx" nogui
vmrun start "D:\Program Files\vms\master07\master07.vmx" nogui

stop.bat

cd D:\Program Files\vm\ D:
vmrun stop "D:\Program Files\vms\master01\CentOS.vmx" soft
vmrun stop "D:\Program Files\vms\master02\master02.vmx" soft
vmrun stop "D:\Program Files\vms\master03\master03.vmx" soft
vmrun stop "D:\Program Files\vms\master04\master04.vmx" soft
vmrun stop "D:\Program Files\vms\master05\master05.vmx" soft
vmrun stop "D:\Program Files\vms\master06\master06.vmx" soft
vmrun stop "D:\Program Files\vms\master07\master07.vmx" soft

你可能感兴趣的:(vmware,bat,命令行,批量启动)