Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PCMCIA.

Status
Not open for further replies.

OrionCookies

Programmer
May 5, 2005
43
US
I have a script to detect if pcmcia card in the slot or not. But its not working,,,,
Need really help on this. or if some one has any example

thanks in advance.
Dell1300 = "PCI\VEN_14E4&DEV_4320"
Dell1350 = "PCI\VEN_14E4&DEV_4320"
Dell1370 = "PCI\VEN_14E4&DEV_4318"
'Dell1400 = "PCI\VEN_14E4&DEV_"

Set SystemSet = GetObject ("winmgmts:").InstancesOf("Win32_PNPEntity")
for each item in SystemSet
If (Instr(item.PNPDeviceID, Dell1300))="1" then WScript.Quit
If (Instr(item.PNPDeviceID, Dell1350))="1" then WScript.Quit

If (Instr(item.PNPDeviceID, Dell1370))="1" then WScript.Quit

Next

WScript.Quit
 
What is not working about it? Is it giving an error? If so, what is the error? Is it not erroring but not detecting the card? Is this the complete script? If not, are you sure this is the part with the problem?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Thanks for replying TomThumbkp.
This is complete script.
It suppose to detect if Pcmcia card in the computer or not. if it is should return value 0
If it is not, value should be 1...

thanks again
 
Well if nothing else, it looks like you never set the return value. So it will always return 0 (that is the default). The first step would be to try changing WScript.Quit to WScript.Quit(0) or WScript.Quit(1) as appropriate for whether the card was detected or not.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I had changed to this.
*****************************************************
Dell1300 = "PCI\VEN_14E4&DEV_4320"
Dell1350 = "PCI\VEN_14E4&DEV_4320"
Dell1370 = "PCI\VEN_14E4&DEV_4318"
'Dell1400 = "PCI\VEN_14E4&DEV_"

Set SystemSet = GetObject ("winmgmts:").InstancesOf("Win32_PNPEntity")
for each item in SystemSet
If (Instr(item.PNPDeviceID, Dell1300))="1" then WScript.Quit
If (Instr(item.PNPDeviceID, Dell1350))="1" then WScript.Quit

If (Instr(item.PNPDeviceID, Dell1370))="1" then WScript.Quit

Next

WScript.Quit(1)

*****************************************
It always return 1 value regardless if card in the slot or not
Another way i tried.
*******************************************
Dell1300 = "PCI\VEN_14E4&DEV_4320"
Dell1350 = "PCI\VEN_14E4&DEV_4320"
Dell1370 = "PCI\VEN_14E4&DEV_4318"
'Dell1400 = "PCI\VEN_14E4&DEV_"

Set SystemSet = GetObject ("winmgmts:").InstancesOf("Win32_PNPEntity")
for each item in SystemSet
If (Instr(item.PNPDeviceID, Dell1300))="1" then WScript.Quit(0)

If (Instr(item.PNPDeviceID, Dell1350))="1" then WScript.Quit(0)

If (Instr(item.PNPDeviceID, Dell1370))="1" then WScript.Quit(0)

'If (Instr(item.PNPDeviceID, Dell1400))="1" then WScript.Quit
Next

WScript.Quit(1)
*****************************************8
same result...

 
And this ?
If Instr(item.PNPDeviceID, Dell1300)>0 Then WScript.Quit(0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
What are the values of PNPDeviceID when the card is/isn't in the slot ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Well it suppose to be when card is in value should be 0
when it is not value should be 1..

if you know any other way to detect pcmcia card please let me know...its a dell truemobile 1300

thanks
 
If you run this code on a computer with the card and a computer without the card, what are the results?

Code:
Dell1300 = "PCI\VEN_14E4&DEV_4320"
Dell1350 = "PCI\VEN_14E4&DEV_4320"
Dell1370 = "PCI\VEN_14E4&DEV_4318"
'Dell1400 = "PCI\VEN_14E4&DEV_"

Set SystemSet = GetObject _ ("winmgmts:").InstancesOf("Win32_PNPEntity")
    for each item in SystemSet
         WScript.Echo item.PNPDeviceID
         If (Instr(item.PNPDeviceID, Dell1300))="1" then WScript.Quit
            If (Instr(item.PNPDeviceID, Dell1350))="1" then WScript.Quit
    
        If (Instr(item.PNPDeviceID, Dell1370))="1" then WScript.Quit

        Next

WScript.Quit

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
oops...replace this:
Set SystemSet = GetObject _ ("winmgmts:").InstancesOf("Win32_PNPEntity")

with this:
Set SystemSet = GetObject ("winmgmts:").InstancesOf("Win32_PNPEntity")

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
And this ?
If Instr(item.PNPDeviceID, Dell1300)>0 Then
WScript.Echo item.PNPDeviceID
WScript.Quit(0)
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
It's inconsistent with your post dated 17 Aug 05 14:29

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Did you try mine? If mine is not echoing anything then there is something fundamentally wrong going on.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
In case you cscript:
If Instr(item.PNPDeviceID, Dell1300)>0 Then
MsgBox item.PNPDeviceID
WScript.Quit(0)
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I know what is going on. If you don't have a driver install. this script won't detect or echo anything. I looked in WINMSD and when the driver is not installed, under signed driver it just display unavailable and deviceid. But when the driver installed. this script works perfectly fine.
Now, i want in computer when card is inserted and it usually brings up drice driver detection window. There got a way to find out if the card is insert or not in there, without any driver install.

Many thanks to all who reply me...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top