Nunzi0 Posted January 12, 2015 Report post Posted January 12, 2015 I've deployed a .cmd file out that contains a WMI script to uninstall all instances of an application called "VirtViewer". The script looks like this: taskkill /F /IM remote-viewer.exe /T wmic product where "name like 'VirtViewer%%'" call uninstall /nointeractive exit /B %EXIT_CODE% Previously, I had used MSI product codes for the uninstall, and got the same result. My original problem, is that there are currently 9 different versions of this app out there, so i am ripping them all out and replacing with 1 version. Installing over an old version does not overwrite the older one, it instead installs a new instance. Reading through the execmgr.log on the client, everything looks as it should. I have attached the execmgr.log to the post. The end result, is that nothing happens. I had originally set the program to run as hidden, but then changed it to normal but still do not see it run. The application is right where i left it, untouched. If i run the script locally it works fine, but not when deployed. Am i missing something?? execmgr.log Quote Share this post Link to post Share on other sites More sharing options...
Nunzi0 Posted January 13, 2015 Report post Posted January 13, 2015 I just tried using powershell to accomplish the same task, and got the same result. Script ran fine, but nothing resulted. 0 errors in the execmgr.log on the client. Program options: Command Line: Powershell.exe -executionpolicy Bypass -file .\VirtUninstall.ps1 the powershell script looks like this: $app = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -match "VirtViewer*"} $app.Uninstall() exit /B Again, the script runs great when launched locally, but not wehen deployed Quote Share this post Link to post Share on other sites More sharing options...
surfincow Posted January 15, 2015 Report post Posted January 15, 2015 What if you try: taskkill /F /IM remote-viewer.exe /T%windir%\Sysnative\wmic product where "name like 'VirtViewer%%'" call uninstall /nointeractiveexit /B %EXIT_CODE% Quote Share this post Link to post Share on other sites More sharing options...
Nunzi0 Posted January 15, 2015 Report post Posted January 15, 2015 I ended up getting this to work by changing the program environment variables. It was originally trying to uninstall from SYSTEM and was not finding anything. I changed this option to only run when a user was logged in, and run with the users rights and it worked perfectly. This particular program installs on a per user basis, something i was not aware of at the starts 1 Quote Share this post Link to post Share on other sites More sharing options...