Source language: Translate to:

Check if your PC is Laptop or Desktop

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Check if your PC is Laptop or Desktop

Postby AsleyCruz » Tue May 14, 2013 10:23 am

Hi guys! :wink:
The title says it all, tested by me and works 100%!

Try this Free VBScript, hope be useful for you! 8)
Best regards!

http://asleycruz.com/projects/downloads/Laptop_or_Desktop.rar

AsleyCruz
Freelancer - Graphic & Type Designer

FREE NEOBOOK APPS: See Website

.
User avatar
AsleyCruz
 
Posts: 108
Joined: Fri Sep 16, 2011 2:12 pm

Re: Check if your PC is Laptop or Desktop

Postby CN_Iceman » Tue May 14, 2013 11:22 am

Thank's Ernesto.

Greetings.
Greetings/Saludos, Jose.
www.icemansoft.es
User avatar
CN_Iceman
 
Posts: 297
Joined: Tue Mar 01, 2011 11:04 am
Location: España

Re: Check if your PC is Laptop or Desktop

Postby Tony Kroos » Tue May 14, 2013 5:34 pm

Code: Select all
 '-----------------------------
 'Determine the type of PC case
 '-----------------------------
 aType = Split("|Other|Unknown|Desktop|Low Profile Desktop|Pizza Box|Mini Tower|" _
     & "Tower|Portable|Laptop|Notebook|Hand Held|Docking Station|All In One|" _
     & "Sub Notebook|Space-Saving|Lunch Box|Main System Chassis|Expansion Chassis|" _
     & "SubChassis|Bus Expansion Chassis|Peripheral Chassis|Storage Chassis|" _
     & "Rack Mount Chassis|Sealed-Case PC", "|")

 Set oWMIService = GetObject("winmgmts:\\.\root\CIMV2")
 Set cItems = oWMIService.ExecQuery("SELECT * FROM Win32_SystemEnclosure",,48)
 For Each oItem In cItems
     MsgBox "Type of case: " & aType(Join(oItem.ChassisTypes, ","))
 Next


// (c) social.technet.microsoft.com

returns as array, so there can be multiple results (laptop with docking station etc...)
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Re: Check if your PC is Laptop or Desktop

Postby AsleyCruz » Wed May 15, 2013 8:58 pm

Tony Kroos wrote:
Code: Select all
 '-----------------------------
 'Determine the type of PC case
 '-----------------------------
 aType = Split("|Other|Unknown|Desktop|Low Profile Desktop|Pizza Box|Mini Tower|" _
     & "Tower|Portable|Laptop|Notebook|Hand Held|Docking Station|All In One|" _
     & "Sub Notebook|Space-Saving|Lunch Box|Main System Chassis|Expansion Chassis|" _
     & "SubChassis|Bus Expansion Chassis|Peripheral Chassis|Storage Chassis|" _
     & "Rack Mount Chassis|Sealed-Case PC", "|")

 Set oWMIService = GetObject("winmgmts:\\.\root\CIMV2")
 Set cItems = oWMIService.ExecQuery("SELECT * FROM Win32_SystemEnclosure",,48)
 For Each oItem In cItems
     MsgBox "Type of case: " & aType(Join(oItem.ChassisTypes, ","))
 Next


// (c) social.technet.microsoft.com

returns as array, so there can be multiple results (laptop with docking station etc...)


Hi Tony :D
Many thanks for this code, very useful!

Regards!
AsleyCruz
Freelancer - Graphic & Type Designer

FREE NEOBOOK APPS: See Website

.
User avatar
AsleyCruz
 
Posts: 108
Joined: Fri Sep 16, 2011 2:12 pm


Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest