This took enough time to figure out that i want to share it here and hopefully save other time. I wanted a batch file to uninstall Creo 2.0 and assosiated addon from client machines, sounds like an eay task right?
The Admin guide have details on this starting on 157. The instuctions for uninstalling addons (Creo view, quality agent, etc) work as expected. The problems are in the removal of Parametric, Simulate, Help. When you call the uninstall.exe from the batch it fires of a second process pimuninstall.exe to do the actuall removal. But the batch file continues as soon as uninstall.exe finsihes. This causes the next request for uninstall to fail becuase the first one (now running uder pimuninstall.exe) is not finshed. So you have to have the batch file wait for pimuninstall.exe to complete. Below is the batch script to do this, tested on Win7. The key waiting code is between :LOOP1 and :CONTINUE1