Search the Community
Showing results for tags 'workaround?'.
-
Since I got new hardware I'm running into a new Issue that I have trouble to work around. Randomly the script stops responding and I have to stop execution with CTRL + BREAK. If the problem occurs, it does at the Run command in following function: Func _vbmExecute($vbmCMD, $ConsoleWrite = 1, $FileDir = @ProgramFilesDir & "\Oracle\VirtualBox\", $vbmFLAG = "@SW_HIDE") If FileExists(@ProgramFilesDir & "\Oracle\VirtualBox\" & "VBoxManage.exe") Then $FileDir = @ProgramFilesDir & "\Oracle\VirtualBox\" If FileExists($FileDir & "VBoxManage.exe") = 0 Then Switch StringInStr($FileDir, "Program Files (x86)") ;x64 x86 swap Case 0 $FileDir = StringReplace($FileDir, "Files", "Files (x86)", 1) Case Else $FileDir = StringReplace($FileDir, "Files (x86)", "Files", 1) EndSwitch EndIf $vbmCMD = $FileDir &"VBoxManage.exe" & " " & $vbmCMD ; SCRIPT STOPS RESPONDING WITH THIS LINE: Local $PID = Run($vbmCMD, $FileDir, @SW_HIDE, 0x2 + 0x4) ;Catch Response Local $ResponseText, $ErrorText, $rTimer = TimerInit() While TimerDiff($rTimer) < 15000 $ResponseText &= StdoutRead($PID) $ErrorText &= StderrRead($PID) If @error Then ExitLoop WEnd If $ConsoleWrite = 1 Then ConsoleWrite($ResponseText) ConsoleWriteError($ErrorText) EndIf Return($ResponseText) #comments-start clonevm <target> --name <name> --basefolder <basefolder> --register startvm <target> controlvm <target> poweroff unregistervm <target> --delete http://www.virtualbox.org/manual/ch08.html #comments-end EndFunc ;==>_vbmExecute The last time it stopped trying to poweroff the VM. How can I prevent the script from hanging when VBoxManage.exe messes up again?