Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

how to discern between Laptop and Desktop?

- - - - -

  • Please log in to reply
15 replies to this topic

#1
honestvip

honestvip

    Newbie

  • Member
  • 16 posts
  • Joined 12-August 12
  • OS:none specified
  • Country: Country Flag
how to discernment between Laptop and Desktop?
Commands?or Condition
THX


How to remove advertisement from MSFN

#2
ricktendo

ricktendo

    Group: Banned Members

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,307 posts
  • Joined 06-June 06
  • OS:Windows 7 x64
  • Country: Country Flag
Use condition

getSystemEnclosureType()=="Laptop"

getSystemEnclosureType()=="Desktop"


#3
honestvip

honestvip

    Newbie

  • Member
  • 16 posts
  • Joined 12-August 12
  • OS:none specified
  • Country: Country Flag
how to use this code ? once ?

#4
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,802 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
In the conditions section of the config wizard.

#5
honestvip

honestvip

    Newbie

  • Member
  • 16 posts
  • Joined 12-August 12
  • OS:none specified
  • Country: Country Flag
my config no detect laptop
getSystemEnclosureType()=="Laptop"

getSystemEnclosureType()=="Desktop"


#6
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
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

Edited by myselfidem, 30 August 2012 - 01:30 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#7
honestvip

honestvip

    Newbie

  • Member
  • 16 posts
  • Joined 12-August 12
  • OS:none specified
  • Country: Country Flag
getSystemEnclosuretype()=="Laptop"

no detected laptop
in condition Hide

#8
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,802 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
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 Files


Edited by Kelsenellenelvian, 30 August 2012 - 04:31 AM.


#9
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
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!

Edited by myselfidem, 01 September 2012 - 08:28 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#10
honestvip

honestvip

    Newbie

  • Member
  • 16 posts
  • Joined 12-August 12
  • OS:none specified
  • Country: Country Flag
hi
testing in to laptop
information
SystemEnclosuretype()=="Desktop"

#11
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,802 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
Where is the information I requestes? I CANNOT help you without it!

#12
Dynaletik

Dynaletik

    Senior Member

  • Member
  • PipPipPipPip
  • 652 posts
  • Joined 18-September 04
  • OS:none specified
  • Country: Country Flag
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

Edited by Dynaletik, 10 September 2012 - 01:02 AM.


#13
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag

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

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


For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#14
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag

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

Edited by myselfidem, 12 September 2012 - 05:38 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#15
Dynaletik

Dynaletik

    Senior Member

  • Member
  • PipPipPipPip
  • 652 posts
  • Joined 18-September 04
  • OS:none specified
  • Country: Country Flag
Yeah, like you said, it says "Notebook" now. :) Thanks m8.

#16
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
Thanks for the test and your sharing! ;)
For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN