ait/os/bin/opensecurityd/vm-start.vbs
author om
Tue, 12 Nov 2013 11:31:34 +0100
branchom
changeset 2 c9bf2537109a
permissions -rwxr-xr-x
added C/C++ and Python sources
     1 Option Explicit
     2 
     3 ' ------------------------------------------------------------
     4 ' start the VMs in the background and mount "network" shares
     5 '
     6 ' Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
     7 '
     8 ' Copyright (C) 2013 AIT Austrian Institute of Technology
     9 ' AIT Austrian Institute of Technology GmbH
    10 ' Donau-City-Strasse 1 | 1220 Vienna | Austria
    11 ' http://www.ait.ac.at
    12 ' ------------------------------------------------------------
    13 
    14 Dim cShell
    15 Dim nError
    16 
    17 ' get the Windows Scripting Host Shell
    18 Set cShell = CreateObject("WScript.Shell")
    19  
    20 ' Start the VM
    21 cShell.Run """C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe"" startvm ""Debian 7"" --type headless", 0, True
    22 
    23 ' Mount the VM Internal "Downloads" folder
    24 Do 
    25 	nError = cShell.Run("net view \\192.168.56.15", 0, True)
    26 	If nError <> 0 Then
    27 		WScript.Sleep 100
    28 	End If
    29 Loop While nError <> 0
    30 nError = cShell.Run("net use Z: \\192.168.56.15\Downloads", 0, True)