Is this a laptop or Pc? (detection)

Just starting out? Need help? Post your questions and find answers here.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

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

Post 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:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Mohawk70
Enthusiast
Enthusiast
Posts: 404
Joined: Thu May 11, 2006 1:04 am
Location: Florida, USA

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

Post 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 ?
HP Z800 Workstation
CPU : Dual Xeon 5690 3.46GHz
RAM : 192GB RAM
GPU : NVIDIA QUADRO P5000 16GB
Post Reply