WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

WMI
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

PCMCIA Card Detection


Question:

Help! We now have Verizon Wireless Cards that insert into the PCMCIA slot of our laptops. Once inserted the "Safely Remove Hardware" icon in the tray comes on and it shows a "NEC PCI to USB Open Host Controller". All afternoon I've been trying to find a way to detect the card.

Don't need (yet anyhow) to control the card - just to insure it's inserted before the update script I've written runs. Yes - someone attempted to run it without the card inserted and now I'm told to fix it... I thought of 2x4's or firecrackers, but they failed to see the humor. Ideas WAY welcome!

Answer:

Winbatch Version: 2005C -- Script By Jay Alverson




;   try this...it found my LinkSys PCMCIA card...
;   the commented section and CLass will enumerate the physical slots...

Locator = ObjectOpen("WbemScripting.SWbemLocator")
Service = Locator.ConnectServer()
Security = Service.Security_
Security.ImpersonationLevel = 3

;Class = "Win32_PCMCIAController"
Class = "Win32_PnPEntity"

Instance = Service.InstancesOf(Class)
colItems = ObjectCollectionOpen(Instance)

colInfo = ""

Message("Debug", colItems.count)

ForEach objItem In colItems
;    colInfo = strcat(colInfo, "Configuration Manager Error Code: ", objItem.ConfigManagerErrorCode, @lf)
;    colInfo = strcat(colInfo, "Configuration Manager User Configuration: ", objItem.ConfigManagerUserConfig, @lf)
;    colInfo = strcat(colInfo, "Device ID: ", objItem.DeviceID, @lf)
;    colInfo = strcat(colInfo, "Manufacturer: ", objItem.Manufacturer, @lf)
;    colInfo = strcat(colInfo, "Name: ", objItem.Name, @lf)
;    colInfo = strcat(colInfo, "PNP Device ID: ", objItem.PNPDeviceID, @lf)
;    colInfo = strcat(colInfo, "Protocol Supported: ", objItem.ProtocolSupported, @lf)

    colInfo = StrCat(colInfo, "Class GUID: " , objItem.ClassGuid, @CRLF)
    colInfo = StrCat(colInfo, "Description: " , objItem.Description, @CRLF)
    colInfo = StrCat(colInfo, "Device ID: " , objItem.DeviceID, @CRLF)
    colInfo = StrCat(colInfo, "Manufacturer: " , objItem.Manufacturer, @CRLF)
    colInfo = StrCat(colInfo, "Name: " , objItem.Name, @CRLF)
    colInfo = StrCat(colInfo, "PNP Device ID: " , objItem.PNPDeviceID, @CRLF)
    colInfo = StrCat(colInfo, "Service: " , objItem.Service, @CRLF)


    colInfo = StrCat(colInfo, @LF)
Next

Message("Debug", colInfo)
ClipPut(colInfo)

Exit
;   and found this...
Class GUID: {4D36E972-E325-11CE-BFC1-08002BE10318}
Description: Wireless-B Notebook Adapter
Device ID: PCI\VEN_10EC&DEV_8180&SUBSYS_00191737&REV_20\5&9F26CDD&0&0010F0
Manufacturer: Linksys Group Inc.
Name: Wireless-B Notebook Adapter
PNP Device ID: PCI\VEN_10EC&DEV_8180&SUBSYS_00191737&REV_20\5&9F26CDD&0&0010F0
Service: LSWPCv4

I can't test without killing my INet connection, so ... just in case you need additional ideas... http://www.microsoft.com/technet/scriptcenter/scripts/hardware/devices/hwdevbo3.mspx

User Reply:

PERFECT! Thank you, this is the exact solution that I was looking for. I simply scan the return string for the card - if found we go, if not we stop.
Article ID:   W17322
File Created: 2007:07:03:14:29:28
Last Updated: 2007:07:03:14:29:28