Parse Modem Com port from msinfo32 text file

Ultimate Windows 7 ultimate 64-bit
May 26, 2010 at 14:39:48
Specs: Windows 7
I'm no expert in this field so I'm here to ask all of you for some help.

So far, I have this...

"%CommonProgramFiles%\Microsoft Shared\MSInfo\MSINFO32.EXE" /report %TEMP%\pcinfo.txt

Which gives me a temp file of the pcinfo.

Now, inside this file is section called [Modem] and I need to find a specific modem then output what COM port it is on.

For instance:

I have 2 modem devices on my laptop. How could I identify the second device instead of the first? I'm guessing I would have to qualify the device I want to identify such as


HP un2420 Mobile Broadband Module Modem


Then I would need to find the "Attached to" in order for the script to return "COM18"

But how do I get there???

Sorry if this is WAY over my head but I am trying. Any help would be GREAT!!!

[Modem]

Item Value
Name Agere Systems HDA Modem
Description Agere Systems HDA Modem
Device ID HDAUDIO\FUNC_02&VEN_11C1&DEV_1040&SUBSYS_103C1378&REV_1002\4&2A00D256&0&0101
Device Type Internal Modem
Attached To COM3
Answer Mode Not Available
PNP Device ID HDAUDIO\FUNC_02&VEN_11C1&DEV_1040&SUBSYS_103C1378&REV_1002\4&2A00D256&0&0101
Provider Name Agere
Modem INF Path oem27.inf
Modem INF Section AGERE_HDA
Blind Off X4
Blind On X3
Compression Off %C0
Compression On %C1
Error Control Forced \N4
Error Control Off \N1
Error Control On \N3
Flow Control Hard &K3
Flow Control Off &K0
Flow Control Soft &K4
DCB 
Default <
Inactivity Timeout 0
Modulation Bell B1B16B2
Modulation CCITT B0B15B2
Prefix AT
Pulse P
Reset AT&F<cr>
Responses Key Name Agere Systems HDA Modem::Agere::Agere
Speaker Mode Dial M1
Speaker Mode Off M0
Speaker Mode On M2
Speaker Mode Setup M3
Speaker Volume High L3
Speaker Volume Low L0
Speaker Volume Med L2
String Format Not Available
Terminator <cr>
Tone T

Name HP un2420 Mobile Broadband Module Modem
Description HP un2420 Mobile Broadband Module Modem
Device ID Modem3
Device Type External Modem
Attached To COM18
Answer Mode Not Available
PNP Device ID Not Available
Provider Name Qualcomm Incorporated
Modem INF Path oem23.inf
Modem INF Section Modem2
Blind Off Not Available
Blind On Not Available
Compression Off Not Available
Compression On Not Available
Error Control Forced Not Available
Error Control Off Not Available
Error Control On Not Available
Flow Control Hard Not Available
Flow Control Off Not Available
Flow Control Soft Not Available
DCB 
Default
Inactivity Timeout 0
Modulation Bell Not Available
Modulation CCITT Not Available
Prefix AT
Pulse P
Reset AT&F<cr>
Responses Key Name HP un2420 Mobile Broadband Module Modem::Qualcomm Incorporated::Qualcomm Incorporated
Speaker Mode Dial Not Available
Speaker Mode Off Not Available
Speaker Mode On Not Available
Speaker Mode Setup Not Available
Speaker Volume High Not Available
Speaker Volume Low Not Available
Speaker Volume Med Not Available
String Format Not Available
Terminator <cr>
Tone T


See More: Parse Modem Com port from msinfo32 text file

Report •

#1
May 26, 2010 at 15:54:21
@echo off & setLocal EnableDELAYedeXpansion

for /f "tokens=* delims= " %%a in ('find "Attached" ^< modems') do (
set M=%%a
)
echo.!M!


=====================================
Helping others achieve escape felicity

M2


Report •

#2
June 1, 2010 at 09:38:10
M2 - That did not work. I need it to look in the temp file named pcinfo.txt

Thanks!


Report •

#3
June 1, 2010 at 10:57:30
So change the name.


=====================================
Helping others achieve escape felicity

M2


Report •
Related Solutions


Ask Question