Jump to content

Batch Script to detect Laptop


Recommended Posts


just use this:

Perfect! :thumbup

Too bad that it will tell you (maybe ) the actual manufacturer name or maybe nothing, definitely won't tell you whether it is portable or not, so you will have (if a value is returned) to use a database of some kind, to see if the particular model returned is a laptop/netbook or a desktop.

jaclaz

Link to comment
Share on other sites

As both jaclaz and CoffeeFiend mentioned earlier, if your systems are Windows Vista or newer then:

@(wmic computersystem get pcsystemtype|find "2">nul 2>&1)&&@(call [encryption stuff])

Using the other WMI class mentioned by jaclaz and used earlier by gunsmokingman:

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
(SET _=)
FOR /F "DELIMS={}" %%# IN (
'2^>NUL WMIC SystemEnclosure GET ChassisTypes^|FIND "}"') DO (
FOR %%$ IN (8 9 10 11 12 14 18 21) DO IF %%#==%%$ SET "_=T")
IF NOT DEFINED _ GOTO :EOF
REM [Encryption stuff here]
ECHO=This is a line of text only visible to a 'portable'

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...