However, the preferred way would be to use the @CSD macro as it is native KiXtart.

BTW, my personal preferences:
1) Native KiXtart command/function/macor
2) Registry read
3) WMI or ADSI
4) other standard COM DLL
5) external DLLs
6) other standard executables
7) external executables

A standard DLL/executable is defined as a fiel that is present in the default build of all computer that are running the particular script

External DLLs/executables are files that need to be installed specifically on computers

Non-native solutions should preferably be implemented via UDFs.
_________________________
There are two types of vessels, submarines and targets.