Updating the Comments on a computer would require authenticating to the Bigfix Console, it’s not something a client should be doing.
For your use case, the best method is still to have your Action write to a file, and an Analysis read the file. You still need to be careful about the number of files you’re reading and the sizes of those files, as reporting them as Analysis properties is going to consume database size. For example 10 KB of file lines reported by ten thousand computers is going to add a hundred megabytes of text to the database.
That said, the basic form of the Action would be something like
folder create "{pathname of parent folder of parent folder of client folder of site "actionsite"}\script-output"
wait cmd.exe /c "run-something.cmd > "{pathname of parent folder of parent folder of client folder of site "actionsite"}\script-output\{id of action}.txt""
In the Analysis, you’d retrieve something like
Property: “Action Logs”
Relevance:
(name of it, lines of it) of files of folders "script-output" of parent folder of parent folder of client folder of site "actionsite"
The results would look like
1.txt, hello from action 1
2.txt, goodbye form action 2
Then from API you could use
values whose (it as string starts with "1.txt") of results whose (name of computer of it = "Computer1") of bes properties "Action Logs"
(to retrieve the results where the computer is “Computer1” and the action ID was “1”)
(the relevance for parent folder of parent folder of client folder of site "actionsite"
can be made much simpler with things like ‘data folder of client’ and ‘storage folder of client’ but I still use the older form because it’s compatible to much earlier BES Client versions)