Skip to content

Instantly share code, notes, and snippets.

@deeperton
Last active December 16, 2015 02:28
Show Gist options
  • Save deeperton/5362303 to your computer and use it in GitHub Desktop.
Save deeperton/5362303 to your computer and use it in GitHub Desktop.
The script suspends all running virtual machines.
@FOR /F "tokens=*" %%G IN ('VBoxManage list runningvms') DO @CALL :suspend %%G
:suspend
@SETLOCAL
@SET _name=%1
@SET _uuid=%2
@IF [%1]==[] GOTO:eof
@echo Suspend: %_name%
VBoxManage controlvm %_uuid% savestate
@ENDLOCAL
@EXIT 0
@deeperton
Copy link
Author

Windows Bathfile.

The script suspends all running virtual machines.

Path to the VBoxManage.exe must by added to the system PATH variable.

for x64

SET PATH=%PATH%C:\Program Files\Oracle\VirtualBox;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment