Thats the code thats in the wsf file
there are no constants in.
<job id="powerOn">
<reference object="VixCOM.VixLib" />
<script language="VBScript" src="powerOn1.vbs" />
</job>
But i made msgboxes ad get the constants.
But now i have the next error in this script. (thats an example you wrote anywhere in the forum)
i got the error on line 15 ( Set host = results(0) ) types not matching results
sub main
Dim lib
Dim host
Dim vm
Dim err
Dim results
Dim job
Set lib = CreateObject("VixCOM.VixLib") ' instantiate a COM object
' use obtained COM object
Set job = lib.Connect(1, 3, Empty, 0, Empty, Empty, 0, Nothing, Nothing)
' results needs to be initialized before it's used, even if it's just going to be overwritten.
Set results = Nothing
err = job.Wait(Array(3010), results)
If lib.ErrorIndicatesFailure(err) Then
' Handle the error...
End If
Set host = results(0)
Set job = host.OpenVM("d:\virtual machines\windows server 2003 enterprise edition\windows server 2003 enterprise edition.vmx", Nothing)
err = job.Wait(Array(3010), results)
If lib.ErrorIndicatesFailure(err) Then
' Handle the error...
End If
Set vm = results(0)
Set job = vm.PowerOn(512, Nothing, Nothing)
err = job.WaitWithoutResults()
If lib.ErrorIndicatesFailure(err) Then
' Handle the error...
End If
end sub