in reply to software inventory

The first step is to describe your problem, but it still does not work doesn't tell us what's going wrong.

The system call looks suspicious indeed, you need to quote all of the arguments into one string.