That information is not accessible from within a script. First off, hyper-threading is supported at the BIOS level. Thus the BIOS may present a 4-core cpu as an 8 or 16 cores when hyper-theading is enabled. The Materials Studio installer picks this up and uses it.
To specify the number of cores used by scripting jobs, you go into Tools | Scripting | Script job.