Jump to content


Nunzi0

Deploying a .cmd script, not working

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.