Keine GUI interaktion (mit vmrun.exe) in der VM (Guest) möglich

Hilfe bei Problemen mit der Installation und Benutzung der VMware Workstation und VMware Workstation Pro.

Moderatoren: irix, Dayworker

Member
Beiträge: 7
Registriert: 21.12.2010, 15:10

Keine GUI interaktion (mit vmrun.exe) in der VM (Guest) möglich

Beitragvon funkmasterroch » 03.07.2023, 12:55

Hallo zusammen,
wenn ich das folgende Powershell Skript im Guest (Windows Powershell ISE) laufen lasse, funktioniert alles wie erwartet.
Es öffnet ein Fenster (siehe Bild), fokusiert es und drückt TAB --> ENTER um die Applikation zu installieren.

Code: Alles auswählen


   add-type -AssemblyName microsoft.VisualBasic
   add-type -AssemblyName System.Windows.Forms
   
   
   try {
      WriteIntoLogFile("Starting installation")
         
      $windowTitle = "Installer"
   
      Start-Process -FilePath "C:\temp\installMe.exe"   
      
      start-sleep -Milliseconds 30000      
   
      [Microsoft.VisualBasic.Interaction]::AppActivate($windowTitle)
      [System.Windows.Forms.SendKeys]::SendWait("{TAB}")
      [System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
      
   }
   catch {
         
      WriteErrorIntoLogFile("Could not install installMe.exe" + $_.Exception.Message)
   }   


Mein Problem ist aktuell, dass wenn ich versuche das Powershell Skript über den Host (vmrun.exe) zu triggern, das fokusieren des Fensters (Installer) nicht funktioniert.

"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" -gu user -gp 123 runProgramInGuest C:\VMs\VM1\VM1.vmx -interactive C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file C:\KickstarterCache\MSCV5\powershell.ps1

Hat jemand dafür eine Erklärung und evtl. einen Lösungsvorschlag wie ich das zum laufen bringe?

Gruß + Danke
Dateianhänge
TAInstaller.png
TAInstaller.png (9.11 KiB) 696 mal betrachtet

Zurück zu „VMware Workstation und VMware Workstation Pro“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 4 Gäste