Fair enough: it wasn’t speedy, but how often are you doing it? A single regex
to extract the stuff was pretty cool, though, I thought (although the $ in the
middle was superfluous). I do like them.
Jeremy
Jeremy Roussak
j...@mac.com
> On 15 Jul 2017, at 16:49, Cannon Smith via 4D_Tech <4d_t
Hi Jeremy,
Thanks for the code. I started out using system_profiler but found it was too
slow for my purposes. I ended up using sysctl and sw_vers on the Mac side which
got me what I wanted and it very fast.
Thanks.
--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-323
Canon,
This seems to work, on my MacBook at any rate. Can’t help with Windows.
C_TEXT($in;$out;$pattern;$model;$swVersion)
LAUNCH EXTERNAL PROCESS("/usr/sbin/system_profiler SPHardwareDataType
SPSoftwareDataType";$in;$out)
ARRAY LONGINT($starts;0)
ARRAY LONGINT($lens;0)
$pattern:="(?m)Model Na
Hi,
On Windows you can use "wmic" to access this kind of information (LEP).
On Mac OS X you can use "system_profiler" (LEP).
I'll send you some sample code to do this.
HTH
Bruno
**
4D Internet Users Group (4D iNUG)
FAQ: http:
And to get the model name on Windows you can use WMIC like this:
WMIC CSPRODUCT GET NAME
http://www.microcenter.com/tech_center/article/6090/how_to_find_your_computer_model_number_in_windows_8
-Tim
**
4D Internet Users Group
> Not sure about the Model Name.
Try this on Mac: http://kb.4d.com/assetid=48861
Not sure about Windows...
-Tim
**
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.
, July 13, 2017 10:11 AM
To: 4D iNug Technical
Cc: Cannon Smith
Subject: Getting Computer and OS Info
I’d like to programmatically get two pieces of system information from within
4D.
1. Model name. Ex. "MacBook Pro" or "Inspiron 24 3000".
2. OS Version. Ex. "Windows 7.1 SP
I’d like to programmatically get two pieces of system information from within
4D.
1. Model name. Ex. "MacBook Pro" or "Inspiron 24 3000".
2. OS Version. Ex. "Windows 7.1 SP2" or "macOS 10.12.5"
It needs to work for both platforms. Does anyone have some code to do this they
wouldn’t mind sharing
8 matches
Mail list logo