PowerCLI

 View Only
  • 1.  VMware tools registry cleanup

    Posted Nov 04, 2019 04:28 PM

    Hi Team,

    I have issues updating/reinstall tools where MSI package is being searched in temp local but couldn't be found. I managed to fix it by manually removing below registry entries and reboot it to load vmtools from update manager. I have also got below script to do it and it doesn't seems to work. Can anyone please point out whats missing in the batch file?

    HKLM:\Software\Microsoft\Windows\CurrentVersion\uninstall\<need to find key matching dword for VMware Tools>
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\<need to find key matching dword for VMware Tools>
     
    Batch file:
    echo Windows Registry Editor Version 5.00>%temp%\removeToolsRegistry.reg
    for /f %%a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s /f "VMware Tools" ^| find "HKEY_LOCAL_MACHINE"') do echo [-%%a]>>%temp%\removeToolsRegistry.reg
    for /f %%a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products /s /f "VMware Tools" ^| find "HKEY_LOCAL_MACHINE"') do set key=%%a
    echo [-%key:~0,-18%]>>%temp%\removeToolsRegistry.reg
    regedit -s %temp%\removeToolsRegistry.reg
     
    Thanks,
    Hari.


  • 2.  RE: VMware tools registry cleanup

    Posted Nov 05, 2019 07:54 AM

    How do you run that script inside the VM's guest OS? Via Invoke-VMScript?

    Do you get any error messages?



  • 3.  RE: VMware tools registry cleanup

    Posted Nov 07, 2019 12:57 PM

    Sorry for the late update. I just tested it directly running inside guest as batch file.

    As I run, it just pulls out code on the command prompt and then just gets back to prompt without any errors. But the registry entry remain without any modification.

    Is there any other efficient methods to get this done?



  • 4.  RE: VMware tools registry cleanup

    Posted Nov 07, 2019 02:54 PM

    Can you try changing that last line to

    regedit %temp%\removeToolsRegistry.reg

    That way you should see the eventual feedback from the regedit command.



  • 5.  RE: VMware tools registry cleanup

    Posted Nov 11, 2019 01:51 PM

    I will test this and update