MSFN Forum: how to discern between Laptop and Desktop? - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

how to discern between Laptop and Desktop? Rate Topic: -----

#1 User is offline   honestvip 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 12-August 12
  • OS:none specified
  • Country: Country Flag

Posted 14 August 2012 - 11:44 PM

how to discernment between Laptop and Desktop?
Commands?or Condition
THX


#2 User is offline   ricktendo 

  • Group: Banned Members
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,229
  • Joined: 06-June 06
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 14 August 2012 - 11:53 PM

Use condition

getSystemEnclosureType()=="Laptop"

getSystemEnclosureType()=="Desktop"


#3 User is offline   honestvip 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 12-August 12
  • OS:none specified
  • Country: Country Flag

Posted 14 August 2012 - 11:57 PM

how to use this code ? once ?

#4 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,326
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 15 August 2012 - 01:16 AM

In the conditions section of the config wizard.

#5 User is offline   honestvip 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 12-August 12
  • OS:none specified
  • Country: Country Flag

Posted 29 August 2012 - 07:33 AM

my config no detect laptop
getSystemEnclosureType()=="Laptop"

getSystemEnclosureType()=="Desktop"


#6 User is online   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 29 August 2012 - 08:19 AM

Inside Configuration Section, select your app and:

Dependant of | Architecture Tab and Hardware [scrowl down inside the combo box, and Select: getSystemEnclosuretype()]!

If you want you can change the condition manually and write: getSystemEnclosuretype()=="Laptop"

Because informations are based on your current Hardware and Operating System!

Cheers

This post has been edited by myselfidem: 30 August 2012 - 01:30 AM


#7 User is offline   honestvip 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 12-August 12
  • OS:none specified
  • Country: Country Flag

Posted 30 August 2012 - 04:23 AM

getSystemEnclosuretype()=="Laptop"

no detected laptop
in condition Hide

#8 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,326
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 30 August 2012 - 04:29 AM

Provide me your wpi install log and I will see what is going on.

See the information screen I am providing? Make one of those too please.

Attached File(s)


This post has been edited by Kelsenellenelvian: 30 August 2012 - 04:31 AM


#9 User is online   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 01 September 2012 - 05:06 AM

Oops, I see now on SystemEnclosureType inside wmi.js !

WMI Tasks: Computer Hardware

How Can I Determine if a Computer is a Laptop or a Desktop Machine?

Regards

*Edit: @honestvip

You can try this vbs file. Copy and past this one with notepad and save as SystemEnclosureType.vbs

strComputer = "." 
Set objWMIService = GetObject("winmgmts:" _ 
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
Set colChassis = objWMIService.ExecQuery _ 
    ("Select * from Win32_SystemEnclosure") 
For Each objChassis in colChassis 
    For  Each strChassisType in objChassis.ChassisTypes 
        Select Case strChassisType 
            Case 1 
                Wscript.Echo "Other" 
            Case 2 
                Wscript.Echo "Unknown" 
            Case 3 
                Wscript.Echo "Desktop" 
            Case 4 
                Wscript.Echo "Low Profile Desktop" 
            Case 5 
                Wscript.Echo "Pizza Box" 
            Case 6 
                Wscript.Echo "Mini Tower" 
            Case 7 
                Wscript.Echo "Tower" 
            Case 8 
                Wscript.Echo "Portable" 
            Case 9 
                Wscript.Echo "Laptop" 
            Case 10 
                Wscript.Echo "Notebook" 
            Case 11 
                Wscript.Echo "Handheld" 
            Case 12 
                Wscript.Echo "Docking Station" 
            Case 13 
                Wscript.Echo "All-in-One" 
            Case 14 
                Wscript.Echo "Sub-Notebook" 
            Case 15 
                Wscript.Echo "Space Saving" 
            Case 16 
                Wscript.Echo "Lunch Box" 
            Case 17 
                Wscript.Echo "Main System Chassis" 
            Case 18 
                Wscript.Echo "Expansion Chassis" 
            Case 19 
                Wscript.Echo "Sub-Chassis" 
            Case 20 
                Wscript.Echo "Bus Expansion Chassis" 
            Case 21 
                Wscript.Echo "Peripheral Chassis" 
            Case 22 
                Wscript.Echo "Storage Chassis" 
            Case 23 
                Wscript.Echo "Rack Mount Chassis" 
            Case 24 
                Wscript.Echo "Sealed-Case PC" 
            Case Else 
                Wscript.Echo "Unknown" 
            End Select 
    Next 
Next 



Testing on your Laptop you must find also the result!

This post has been edited by myselfidem: 01 September 2012 - 08:28 AM


#10 User is offline   honestvip 

  • Newbie
  • Group: Members
  • Posts: 16
  • Joined: 12-August 12
  • OS:none specified
  • Country: Country Flag

Posted 09 September 2012 - 11:32 PM

hi
testing in to laptop
information
SystemEnclosuretype()=="Desktop"

#11 User is online   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,326
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 10 September 2012 - 12:45 AM

Where is the information I requestes? I CANNOT help you without it!

#12 User is offline   Dynaletik 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 652
  • Joined: 18-September 04
  • OS:none specified
  • Country: Country Flag

Posted 10 September 2012 - 01:00 AM

For me on my Laptop, getSystemEnclosureType() is Desktop, too, but getSysPCType() gives me Mobile. So use that one instead
Could you perhaps add those cases you just mentioned myselfidem? (At least the most common ones perhaps)

Your .vbs script gives me "Notebook" as result. Thought Laptop and Notebook would be the same. :D

This post has been edited by Dynaletik: 10 September 2012 - 01:02 AM


#13 User is online   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 10 September 2012 - 03:55 AM

View PostDynaletik, on 10 September 2012 - 01:00 AM, said:

Your .vbs script gives me "Notebook" as result. Thought Laptop and Notebook would be the same. :D

Yes!

We can read here more informations about Laptop and Notebook:

Laptop

Quote

Laptops are also sometimes called notebook computers, notebooks or netbooks.


#14 User is online   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 12 September 2012 - 03:54 AM

View PostDynaletik, on 10 September 2012 - 01:00 AM, said:

Could you perhaps add those cases you just mentioned myselfidem? (At least the most common ones perhaps)

Done! :)
You can try to apply this changes inside wmi.js and look if it works for you:

http://www.msfn.org/...ost__p__1011110

Regards

This post has been edited by myselfidem: 12 September 2012 - 05:38 AM


#15 User is offline   Dynaletik 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 652
  • Joined: 18-September 04
  • OS:none specified
  • Country: Country Flag

Posted 12 September 2012 - 07:40 AM

Yeah, like you said, it says "Notebook" now. :) Thanks m8.

#16 User is online   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,393
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 12 September 2012 - 08:59 AM

Thanks for the test and your sharing! ;)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy