Page 3 of 3

Re: Is this a laptop or Pc? (detection)

Posted: Thu Mar 13, 2014 7:07 pm
by Thunder93
Yes... The very first post I made on this topic, that code was a very old one I used. But like you've seen for yourself, it does have a draw-back.

Pretty big one since there are so many still with old laptops and have removed their dead or poor batteries out and just using it as a stationary computer and plugged into the wall. That's not to say having left the dead battery in still wouldn't yield the same results.

Having done all that research yesterday... something good came from it. Wasn't looking to hopeful when I first started.

Anyhoots! I'm glad we all have something to work with. Now go say PureBasic three times and get back to programming, and you should be fine the next morning. :mrgreen:

Re: Is this a laptop or Pc? (detection)

Posted: Thu Mar 13, 2014 8:20 pm
by Mohawk70
doctorized wrote:
em_uk wrote:The best way to do this is check the WMI System eclosure type, I am at work right now so can't script this up into Commate (However I have done it many times)

..................

Forget the CPU / battery approach!
What is the value that I should look at?

@Thunder93: your first code is not running with PB x86, invalid memory access (read error at address 0) for line 95 occurs, but is running fine with PB x64.

Shouldn't the value of LidPresent.b tell you whether or not it's a laptop ... if lid is present , then it is a laptop ? Anyone know a reason this wouldn't work ?