Created
June 15, 2011 00:34
-
-
Save xnrghzjh/1026262 to your computer and use it in GitHub Desktop.
VirtualBoxの仮想マシンを非表示で管理(wsfから移植)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
// VirtualBoxのパス | |
path = "C:\\Program Files\\Oracle\\VirtualBox\\" | |
// 仮想マシンのリスト | |
list = ['RedMine', 'DokuWiki'] | |
// 引数チェック | |
if (args.size() == 0) { | |
JOptionPane.showMessageDialog(null, "引数を指定してください\n 起動:On 停止:Off", "起動エラー", JOptionPane.ERROR_MESSAGE) | |
return | |
} | |
switch (args[0]) { | |
case "On": | |
list.each { "${path}VBoxHeadless.exe -s ${it}".execute() } | |
break; | |
case "Off": | |
list.each { "${path}VBoxManage.exe controlvm ${it} acpipowerbutton".execute() } | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment