The following script works just fine if it is ran from cmd, but not as a KACE script. The CMD line flashes and it looks like the packages is uninstalled but no change has been made to the system. After at restart, IE 11 i still installed. The log file says the script was run successfully.

FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart"

Any advice is appreciated

Regards
Haakon
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0
for anyone still that needs this working via Kace , change how you call on cmd by using sysnative vairable , this only when targeting x64 windows.

FORFILES /P C:\Windows\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "C:\Windows\sysnative\cmd.exe /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /Verbose /norestart" >c:\logs\uninstallie.log
Answered 11/05/2015 by: olgonzo
Senior Yellow Belt

Please log in to comment
0
When the script "flashes", it may be displaying an error message, so the first thing I would do is to pipe the output of the command string to a file which you can examine after the script runs.

Just add       > c:\logs\IE11Uninstall.log  (or whatever path you prefer) to the end of your command line.

As a rule, I always include the full path to any executable I call, just in case the installation does not have a path variable set.  So instead of cmd, I would use c:\windows\system32\cmd.exe.
Answered 07/15/2014 by: EdT
Red Belt

Please log in to comment
0
My guess is that your script needs administrator rights to uninstall.  By default, a Kscript is going to run as LocalSystem. Try using the "run as" feature and supplying admin credentials.
Answered 07/16/2014 by: jknox
Red Belt

Please log in to comment
0
Thanks to EdT and jknox for great suggestions. I have modified the script slightly and it seems that I am one step further, but IE 11 is still there.

FORFILES /P C:\Windows\servicing\Packages /M Microsoft-Windows-InternetExplorer-*11.*.mum /c "C:\Windows\system32\cmd.exe /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /Verbose /norestart" >c:\logs\uninstallie.log

The script is working when I run it locally. If i try to run it form Kace with the same user it runs, with no error but IE won't be gone... 
Answered 07/17/2014 by: haakon
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity