1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Starting a Program Based on a Hardware Profile

Discussion in 'Legacy Windows' started by anglin4trouble, 2003/01/14.

Thread Status:
Not open for further replies.
  1. 2003/01/14
    anglin4trouble

    anglin4trouble Inactive Thread Starter

    Joined:
    2003/01/14
    Messages:
    2
    Likes Received:
    0
    Is there a way to load a program based on a hardware profile?

    For example, if I have two profiles, docked and undocked, is there a way to load a program when using the undocked profile but not the docked profile?

    Thanks for your help in advance.
     
  2. 2003/01/14
    Dorfmann

    Dorfmann Inactive

    Joined:
    2002/04/26
    Messages:
    100
    Likes Received:
    0
    Use reg.exe from support.cab on the Win2k CD to query the registry. If you are testing for a specific device e.g. a NIC, could try ping or devcon in a batch file...

    Code:
    devcon status PCI\VEN_1282*|find  "running "
    if errorlevel 1 exit
    rem run program
    start notepad.exe
    pause
    Get the hardware ID of your device from System Information (winmsd).
     

  3. to hide this advert.

  4. 2003/01/14
    anglin4trouble

    anglin4trouble Inactive Thread Starter

    Joined:
    2003/01/14
    Messages:
    2
    Likes Received:
    0
    Thanks for the help. This is not my field, but to solve this would be extremely helpful. I am using the devcon command to determine the status of the NIC on the docking station so that when it returns "disabled" I can choose to run a program. The code I am trying is :
    _________________________________________________

    devcon status PCI\VEN_10B7&DEV_9200&SUBSYS_00A71028&REV_78\4&139E449D&0&40F0|find "disabled "
    if errorlevel 1 exit
    start c:\program files\zone labs\zonealarm\zonealarm.exe
    pause
    _________________________________________________

    My problem is, the batch file executes, it never gets past teh devcon line, I see the status "disabled" and then a bunch of errors - listed below:
    _________________________________________________
    C:\>devcon status PCI\VEN_10B7 & DEV_9200 & SUBSYS_00A71028 & REV_78\4 & 139E449D & 0 & 40F
    0 | find "disabled "
    PCI\VEN_10B7&DEV_9200&SUBSYS_012A1028&REV_78\4&139E449D&0&00F0
    Name: 3Com 3C920 Integrated Fast Ethernet Controller (3C905C-TX Compatible)
    Device is disabled.
    1 matching device(s) found.
    'DEV_9200' is not recognized as an internal or external command,
    operable program or batch file.
    'SUBSYS_00A71028' is not recognized as an internal or external command,
    operable program or batch file.
    The system cannot find the path specified.
    '139E449D' is not recognized as an internal or external command,
    operable program or batch file.
    '0' is not recognized as an internal or external command,
    operable program or batch file.
    '40F0' is not recognized as an internal or external command,
    operable program or batch file.

    C:\>
    _________________________________________________

    Any ideas on how I can get the code to work correctly?

    Thanks so much for your help.
     
  5. 2003/01/15
    Dorfmann

    Dorfmann Inactive

    Joined:
    2002/04/26
    Messages:
    100
    Likes Received:
    0
    Don't use ampersands (&) in your hardware ID. You shouldn't need to use the full hardware ID if you use a wildcard with a unique string. For example....

    Code:
    devcon status *SUBSYS_012A1028|find  "disabled "
    
    devcon status *DEV_9200|find  "disabled "
    
    devcon status PCI\VEN_10B7*|find  "disabled "
     
    Last edited: 2003/01/15
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.