<?XML version="1.0" standalone="yes" ?>
<job>
<runtime>
	<description>
Startet oder beendet eine VirtualBox-VM im headless-Modus ohne sichtbare Fenster
(c) Ronny "Sephiroth" Perinke, 2010 (www.sephiroth-j.de)
	</description>
	<example>
Beispiele:

VM "Foobar" starten:
rundheadless.wsf /action:START /vm:Foobar

VM "Foobar" starten und VRDP aktivieren:
rundheadless.wsf /action:START /vm:Foobar /vrdp

VM "Foobar" stoppen mit acpipowerbutton:
rundheadless.wsf /action:STOP /vm:Foobar
rundheadless.wsf /action:STOP /vm:Foobar /sm:acpi

VM "Foobar" stoppen mit savestate:
rundheadless.wsf /action:STOP /vm:Foobar /sm:save
	</example>
	<named name="action" helpstring="Starten (START) oder Stoppen (STOP)?" required="true" type="string"/>
	<named name="vm" helpstring="Name der VM" required="true" type="string"/>
	<named name="sm" helpstring="Wie soll die VM heruntergefahren werden?" required="false" type="string"/>
	<named name="vrdp" helpstring="VRDP (VirtualBox Remote Desktop Protocol) aktivieren" required="false" type="simple"/>
</runtime>
<object id="WShShell" progid="WScript.Shell"/>
<!--
Den Pfad ggf. anpassen aber normalerweise nicht notwendig
-->
<resource id="VBOX_PATH">%VBOX_INSTALL_PATH%</resource>
<script language="VBScript">
<![CDATA[
Option Explicit

'**Start Encode**
Dim vboxPath : vboxPath = getResource("VBOX_PATH")

Dim argsNamed: Set argsNamed = WScript.Arguments.Named
If argsNamed.Exists("action") And argsNamed.Exists("vm") Then
	Dim ACTION, VM_NAME, STOP_METHOD, VRDP
	ACTION = UCase(Trim(argsNamed("action")))
	VM_NAME = Trim(argsNamed("vm"))
	STOP_METHOD = "acpipowerbutton"
	VRDP = "off"
	
	If ACTION = "START" Then
		If argsNamed.Exists("vrdp") Then
			VRDP = "on"
		End If
		WshShell.Run """" & vboxPath & "VboxHeadless"" -v " & VRDP & " -s """ & VM_NAME & """", 0
	Elseif ACTION = "STOP" Then
		If argsNamed.Exists("sm") Then
			Dim smArg : smArg = UCase(argsNamed("sm"))
			If smArg = "ACPI" Then
				STOP_METHOD = "acpipowerbutton"
			Elseif smArg = "SAVE" Then
				STOP_METHOD = "savestate"
			End If
		End If
		WshShell.Run """" & vboxPath & "VboxManage"" controlvm """ & VM_NAME & """ " & STOP_METHOD, 0
	Else
		WScript.Echo "Fehler: ungueltige Action " & ACTION
	End If
Else
	WScript.Echo "Fehler: ungueltige Parameter"
	WScript.Arguments.ShowUsage
	WScript.Quit
End If
]]>
</script>

<signature>
** SIG ** MIIQ2wYJKoZIhvcNAQcCoIIQzDCCEMgCAQExCzAJBgUr
** SIG ** DgMCGgUAMGcGCisGAQQBgjcCAQSgWTBXMDIGCisGAQQB
** SIG ** gjcCAR4wJAIBAQQQcAVhGs441BGiowAQS9NQkAIBAAIB
** SIG ** AAIBAAIBAAIBADAhMAkGBSsOAwIaBQAEFATgW8SsTxHx
** SIG ** E5X78bU5KwXcBUxmoIIMqjCCA3owggJioAMCAQICEDgl
** SIG ** 1/r4Ya+e9JDnJrXWWtUwDQYJKoZIhvcNAQEFBQAwUzEL
** SIG ** MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJ
** SIG ** bmMuMSswKQYDVQQDEyJWZXJpU2lnbiBUaW1lIFN0YW1w
** SIG ** aW5nIFNlcnZpY2VzIENBMB4XDTA3MDYxNTAwMDAwMFoX
** SIG ** DTEyMDYxNDIzNTk1OVowXDELMAkGA1UEBhMCVVMxFzAV
** SIG ** BgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQDEytW
** SIG ** ZXJpU2lnbiBUaW1lIFN0YW1waW5nIFNlcnZpY2VzIFNp
** SIG ** Z25lciAtIEcyMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
** SIG ** iQKBgQDEtfJSFbyIhmApFkpbL0uRa4eR8zVUWDXq0TZe
** SIG ** Yk1SUTRxwntmHYnI3SrEagr2N9mYdJH2kq6wtXaW8alK
** SIG ** Y0VHLmsLkk5LK4zuWEqL1AfkGiz4gqpY2c1C8y3Add6N
** SIG ** q8eOHZpsTAiVHt7b72fhcsJJwp5gPOHivhajY3hpFHut
** SIG ** LQIDAQABo4HEMIHBMDQGCCsGAQUFBwEBBCgwJjAkBggr
** SIG ** BgEFBQcwAYYYaHR0cDovL29jc3AudmVyaXNpZ24uY29t
** SIG ** MAwGA1UdEwEB/wQCMAAwMwYDVR0fBCwwKjAooCagJIYi
** SIG ** aHR0cDovL2NybC52ZXJpc2lnbi5jb20vdHNzLWNhLmNy
** SIG ** bDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAOBgNVHQ8B
** SIG ** Af8EBAMCBsAwHgYDVR0RBBcwFaQTMBExDzANBgNVBAMT
** SIG ** BlRTQTEtMjANBgkqhkiG9w0BAQUFAAOCAQEAUMVLyCSA
** SIG ** 3+QNJMLeGrGhAqGmgi0MgxWBNwqCDiywWhdhtdgF/ojb
** SIG ** 8ZGRs1YaQKbrkr44ObB1NnQ6mE/kN7qZicqVQh2wuceg
** SIG ** jVfg+tVkBEI1TgHRM6IXyE2qJ8fy4YZMAjhNg3jG/FPg
** SIG ** 6+AGh92klp5eDJjipb6/goXDYOHfrSjYx6VLZNrHG1u9
** SIG ** rDkI1TgioTOLL4qa67wHIT9EQQkHtWUcJLxI00SA66HP
** SIG ** yQK0FM9UxxajgFz5eT5dcn2IF54sQ6LKU859PfYqOrhP
** SIG ** lAClbQqDXfleU/QYs1cPcMP79a2VoA4X3sQWgGDJDytu
** SIG ** hgTx6/R4J9EFxe40W165STLyMzCCA8QwggMtoAMCAQIC
** SIG ** EEe/GZXfjVJGQ/fbbUgNMaQwDQYJKoZIhvcNAQEFBQAw
** SIG ** gYsxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJu
** SIG ** IENhcGUxFDASBgNVBAcTC0R1cmJhbnZpbGxlMQ8wDQYD
** SIG ** VQQKEwZUaGF3dGUxHTAbBgNVBAsTFFRoYXd0ZSBDZXJ0
** SIG ** aWZpY2F0aW9uMR8wHQYDVQQDExZUaGF3dGUgVGltZXN0
** SIG ** YW1waW5nIENBMB4XDTAzMTIwNDAwMDAwMFoXDTEzMTIw
** SIG ** MzIzNTk1OVowUzELMAkGA1UEBhMCVVMxFzAVBgNVBAoT
** SIG ** DlZlcmlTaWduLCBJbmMuMSswKQYDVQQDEyJWZXJpU2ln
** SIG ** biBUaW1lIFN0YW1waW5nIFNlcnZpY2VzIENBMIIBIjAN
** SIG ** BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqcqypMzN
** SIG ** IK8KfYmsh3XwtE7x38EPv2dhvaNkHNq7+cozq4QwiVh+
** SIG ** jNtr3TaeD7/R7Hjyd6Z+bzy/k68Numj0bJTKvVItq0g9
** SIG ** 9bbVXV8bAp/6L2sepPejmqYayALhf0xS4w5g7EAcfrkN
** SIG ** 3j/HtN+HvV96ajEuA5mBE6hHIM4xcw1XLc14NDOVEpkS
** SIG ** ud5oL6rm48KKjCrDiyGHZr2DWFdvdb88qiaHXcoQFTyf
** SIG ** hOpUwQpuxP7FSt25BxGXInzbPifRHnjsnzHJ8eYiGdvE
** SIG ** s0dDmhpfoB6Q5F717nzxfatiAY/1TQve0CJWqJXNroh2
** SIG ** ru66DfPkTdmg+2igrhQ7s4fBuwIDAQABo4HbMIHYMDQG
** SIG ** CCsGAQUFBwEBBCgwJjAkBggrBgEFBQcwAYYYaHR0cDov
** SIG ** L29jc3AudmVyaXNpZ24uY29tMBIGA1UdEwEB/wQIMAYB
** SIG ** Af8CAQAwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2Ny
** SIG ** bC52ZXJpc2lnbi5jb20vVGhhd3RlVGltZXN0YW1waW5n
** SIG ** Q0EuY3JsMBMGA1UdJQQMMAoGCCsGAQUFBwMIMA4GA1Ud
** SIG ** DwEB/wQEAwIBBjAkBgNVHREEHTAbpBkwFzEVMBMGA1UE
** SIG ** AxMMVFNBMjA0OC0xLTUzMA0GCSqGSIb3DQEBBQUAA4GB
** SIG ** AEpr+epYwkQcMYl5mSuWv4KsAdYcTM2wilhu3wgpo17I
** SIG ** ypMT5wRSDe9HJy8AOLDkyZNOmtQiYhX3PzchT3AxgPGL
** SIG ** OIez6OiXAP7PVZZOJNKpJ056rrdhQfMqzufJ2V7duyuF
** SIG ** PrWdtdnhV/++tMV+9c8MnvCX/ivTO1IbGzgn9z9KMIIF
** SIG ** YDCCA0igAwIBAgIDCRX3MA0GCSqGSIb3DQEBBQUAMHkx
** SIG ** EDAOBgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6
** SIG ** Ly93d3cuY2FjZXJ0Lm9yZzEiMCAGA1UEAxMZQ0EgQ2Vy
** SIG ** dCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
** SIG ** ARYSc3VwcG9ydEBjYWNlcnQub3JnMB4XDTEwMDgyMjIy
** SIG ** MDI0NFoXDTEyMDgyMTIyMDI0NFowQTEWMBQGA1UEAxMN
** SIG ** Um9ubnkgUGVyaW5rZTEnMCUGCSqGSIb3DQEJARYYc2Vw
** SIG ** aGlyb3RoQHNlcGhpcm90aC1qLmRlMIIBIjANBgkqhkiG
** SIG ** 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs1Nxmn1B6vFZFRtG
** SIG ** SohtNu4cqyOuGLveUCHE5IboJMsfo76/MS8136td++wr
** SIG ** UU56rBx5iGF0Bwbzfe+Qvqu3rfEPfrQMJPF6I7/yrplz
** SIG ** ym8LWwbeIi/jjkFeeXhdcnUxlJCqIOPDqdrUevRdKIEs
** SIG ** nirqcwyr5FoWFIuK59UViNKEIWDcuaFumvq+/lMuDHLi
** SIG ** /PjOnYRMASUvskbam3oJurJYOabJtMV2ljkZDfk3HWPg
** SIG ** p+hwrmP/VRM73FSa8sfsMfmsh88+z8pAm2NgEv1Mbv9Y
** SIG ** 0ih6zI2vV1p7Zfe4ft7RrZluuwm5J4PPiIzekBBEbb57
** SIG ** Y7fK82LVJGAJtzjk+QIDAQABo4IBJzCCASMwDAYDVR0T
** SIG ** AQH/BAIwADBWBglghkgBhvhCAQ0ESRZHVG8gZ2V0IHlv
** SIG ** dXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
** SIG ** b3ZlciB0byBodHRwOi8vd3d3LkNBY2VydC5vcmcwYgYD
** SIG ** VR0lBFswWQYIKwYBBQUHAwQGCCsGAQUFBwMCBggrBgEF
** SIG ** BQcDAwYKKwYBBAGCNwIBFQYKKwYBBAGCNwIBFgYKKwYB
** SIG ** BAGCNwoDBAYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMDIG
** SIG ** CCsGAQUFBwEBBCYwJDAiBggrBgEFBQcwAYYWaHR0cDov
** SIG ** L29jc3AuY2FjZXJ0Lm9yZzAjBgNVHREEHDAagRhzZXBo
** SIG ** aXJvdGhAc2VwaGlyb3RoLWouZGUwDQYJKoZIhvcNAQEF
** SIG ** BQADggIBAL7RWfRBC9UGszgua2iVAxvuTKQj9VBbKAOX
** SIG ** CK91v6D3Ngnjwi12v5tH1rWQwAwGJCyB49RhyOAfUGph
** SIG ** bGkwcsDSIXiB4QPIYUty5M/tNzw3nuFXzN3lT/uZUu3Z
** SIG ** 6FHeC4gAETEu3Wzr0HkCmoRasfpQ2KpEAQS8yXrdDcl6
** SIG ** JRf2VhwBeUR19Ys9zYW7RlPZqjA8liFaRdJWHYHOKIX2
** SIG ** l8mI153+K9LvZLQ3dVqd4Y86VIv/qyn3KE7V95QHl8tY
** SIG ** hDdS8HG0AsJ3nnWY86ud4C9IJfe1TBdDG2gLNnNe9xuv
** SIG ** rV9fevOK9zVCr4XrPUVBLGyYn/wRBj6DKfWGWmYOdS25
** SIG ** zANcanR3BZAeTSo62/Ea3mm76SBIoLwkoajyItZDsi6g
** SIG ** U9aRGfTBnH2A42aWfcs1Yg1BTzXDAi07j2YdRIt7DloD
** SIG ** LEHeEjyvE5t79euiYavFO8gQBZpzMH6t7qozLfXSL/gz
** SIG ** ETGqgrruwFOD3aCMvvxc/BuBX6m8QV4nHxcG+QU7KFJ6
** SIG ** Tlm2UE34hyjHk37QhORqj2YURC7O4FpVgoAkYS47tNHH
** SIG ** inFE7nHee89qZaGVyJ8a/jLZxNrfOOH8qCYFFwl6kgWl
** SIG ** IbrOVCquvRCJ+XbvFGZ0LyeyZ96m52GeT2lvTMuDbz6e
** SIG ** ruKv9CSnFAmNU2zMZaV6AnEMHvC8TZxFMYIDnTCCA5kC
** SIG ** AQEwgYAweTEQMA4GA1UEChMHUm9vdCBDQTEeMBwGA1UE
** SIG ** CxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQD
** SIG ** ExlDQSBDZXJ0IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJ
** SIG ** KoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcCAwkV
** SIG ** 9zAJBgUrDgMCGgUAoHAwEAYKKwYBBAGCNwIBDDECMAAw
** SIG ** GQYJKoZIhvcNAQkDMQwGCisGAQQBgjcCAQQwHAYKKwYB
** SIG ** BAGCNwIBCzEOMAwGCisGAQQBgjcCARYwIwYJKoZIhvcN
** SIG ** AQkEMRYEFPfCVUJN5IWSq4XM+Nc6AbCS50JKMA0GCSqG
** SIG ** SIb3DQEBAQUABIIBAJP51ogce2ng79SxT+5pCGWjWX62
** SIG ** AXJSbesx8n1eLo0NAc4RuGucT7jGo+QIlAT/n3RgStNy
** SIG ** +JdB7G/18CuQHcQWKxQnMe/uXS4iOhX1YjWQKDusbqrP
** SIG ** 3VKR82eKInImH4A8+9YaXqv27TjhPAm6rNQ4UCKg5Enw
** SIG ** FF8fB0Rl5FnqtNe22LVZe5hq3W/pPIA6mKQc5GwkFz9V
** SIG ** 5e59IzdJlZHlG9sZ8vQgYswtGlcEsGKYN7Ea0kk7ekc9
** SIG ** 28zhDXe/awtAk4mEN51KuctjixOHGCGdtV2FXFwoCBmd
** SIG ** yIE+XaKfb2J2bxTRjgruCCjKJvisCVcvwq/c8wulaX26
** SIG ** Y3wz1I2hggF/MIIBewYJKoZIhvcNAQkGMYIBbDCCAWgC
** SIG ** AQEwZzBTMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVy
** SIG ** aVNpZ24sIEluYy4xKzApBgNVBAMTIlZlcmlTaWduIFRp
** SIG ** bWUgU3RhbXBpbmcgU2VydmljZXMgQ0ECEDgl1/r4Ya+e
** SIG ** 9JDnJrXWWtUwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJ
** SIG ** AzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEw
** SIG ** MTAyNjE1MTE1MFowIwYJKoZIhvcNAQkEMRYEFMpVGWkC
** SIG ** 6XzL8NA8g8aBky3Qh6d8MA0GCSqGSIb3DQEBAQUABIGA
** SIG ** G/ki4PFGOuZUILx0oW83lWi60BNfXsWbmCuX60jvZFzi
** SIG ** Exi7pSb6yLd6uPi2mKeHNBUXRYORAeGdsE3IjWyXkP7v
** SIG ** 2781ZYsGjTsVVX9ZwU3gFdE+zpiTIB+k/idu3ha6rBp6
** SIG ** bVifnNnhG0PeNM4coRmsIR0zeLejbXyqVPoOL3o=
</signature>
</job>