VMware Cloud Community
haripadmam
Hot Shot
Hot Shot

VMware tools registry cleanup

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.
Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

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

Do you get any error messages?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
haripadmam
Hot Shot
Hot Shot

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?

Reply
0 Kudos
LucD
Leadership
Leadership

Can you try changing that last line to

regedit %temp%\removeToolsRegistry.reg

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
haripadmam
Hot Shot
Hot Shot

I will test this and update

Reply
0 Kudos