Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need help making a reg query batch.

Featured Replies

I need to find out the keystring of my WLAN NIC using a batch query, as I believe this changes on each install.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\13]
"ServiceName"="{65FA9572-A7DB-42EE-8EC5-1D1D41E299FA}"
"Description"="Intel(R) PRO/Wireless 2200BG Network Connection"

So I need a batch that search for Description "Intel® PRO/Wireless 2200BG Network Connection" in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\XX and then return the ServiceName value ({65FA9572-A7DB-42EE-8EC5-1D1D41E299FA}).

Please help me out here! Ive really tried myself but cant figure it out. Yzöwl, I know you know this hehe care to help out?

Edited by BoardBabe

I do not know if this will help but here is a script that checks for the name of

the Network Card using a WMI in a vbs script. This has my and your cards name

in the array.

This script also run a check for working and not working devices and then makes

a txt file that list the results.

Blue Text Is The Array For The Network Cards.

Dim Act, Fso, StrComputer, ChkNCard, Wmi_1, Wmi_Class, InTa

StrComputer = "."

Set Act = CreateObject("Wscript.shell")

Set Fso = CreateObject("Scripting.FileSystemObject")

Wmi_1 = ("winmgmts:\\" & strComputer & "\root\cimv2")

Wmi_Class = Array(("Select * from Win32_PnPEntity"),("Select * from Win32_Processor") )

ChkNCard = Array(("VIA Rhine II Fast Ethernet Adapter"),_

                  ("Intel® PRO/Wireless 2200BG Network Connection"))

''' List Network Adaptor Name

  Set objWMIService =GetObject(Wmi_1)

  Set colNCard = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter",,48)

  For Each objItem in colNCard

  For Each StrChkNCard In ChkNCard

    If objItem.Name = StrChkNCard Then

    Act.Popup "Network Card Name : " & objItem.Name,5,"Confirmed", 0 + 64

    End If

  Next

  Next

'''' List What Devices Are Working

InTa = 100

Set Ts = Fso.OpenTextFile("HWListError.txt",2,True)

    TS.WriteLine  "  <----- Error Code Check 1 Working Devices ----->"

    TS.WriteLine  "  <----- Time Start = " & Time() & " ----->"

Set objWMIService = GetObject(Wmi_1)

Set colItems = objWMIService.ExecQuery(Wmi_Class(0) & " WHERE ConfigManagerErrorCode <> 1")

  For Each objItem in colItems

    InTa = InTa + 1

    TS.WriteLine  Vbcrlf & "  <----- Number Of Device Counter = " & InTa & " ----->" 

    TS.WriteLine  "  Class GUID: " & objItem.ClassGuid

    TS.WriteLine  "  Description: " & objItem.Description

    TS.WriteLine  "  Device ID: " & objItem.DeviceID

    TS.WriteLine  "  Manufacturer: " & objItem.Manufacturer

    TS.WriteLine  "  Name: " & objItem.Name

    TS.WriteLine  "  PNP Device ID: " & objItem.PNPDeviceID

    TS.WriteLine  "  Service: " & objItem.Service & vbCrLf & "  <---------------------------------->"

  Next

    TS.WriteLine  "  <----- Time Finished = " & Time() & " ----->"

    TS.WriteLine  "  <----- Total Amount Of Checks = " & InTa & " ----->"

    TS.Close

    InTa = InTa - InTa

    InTa = 1 - 1

    '''' List What Devices Are Not Working

    InTa = 1000

Set Ts = Fso.OpenTextFile("HWListError.txt",8,True)

    TS.WriteLine  "  <----- Error Code Check 0 Not Working Devices ----->"

    TS.WriteLine  "  <----- Time Start = " & Time() & " ----->" 

Set objWMIService = GetObject(Wmi_1)

Set colItems = objWMIService.ExecQuery(Wmi_Class(0) & " WHERE ConfigManagerErrorCode <> 0")

For Each objItem in colItems

  InTa = InTa + 1

    TS.WriteLine  Vbcrlf & "  <----- Number Of Device Counter = " & InTa & " ----->"

    TS.WriteLine  "  Class GUID: " & objItem.ClassGuid

    TS.WriteLine  "  Description: " & objItem.Description

    TS.WriteLine  "  Device ID: " & objItem.DeviceID

    TS.WriteLine  "  Manufacturer: " & objItem.Manufacturer

    TS.WriteLine  "  Name: " & objItem.Name

    TS.WriteLine  "  PNP Device ID: " & objItem.PNPDeviceID

    TS.WriteLine  "  Service: " & objItem.Service & vbCrLf & "  <---------------------------------->"

  Next

    TS.WriteLine  "  <----- Time Finished = " & Time() & " ----->"

    TS.WriteLine  "  <----- Total Amount Of Checks = " & InTa & " ----->"

    TS.Close

    Act.Run("HWListError.txt")

  • Author

Well, I really never used any vbs scripts. but I tried run this script and it output way too much. I really just need the value of ServiceName so that I can use it as a %variable% to set a registry key with it.

What exactly are you wanting it for?

Have you got more than one Network card?

If yes then do any of them need setting up differently?

I only ask because it may be better to build that functionality into the batch.

Edited by Yzöwl

  • Author

Oh sorry. I have 2 NICS, one WLAN and one LAN. I would like to set the MTU of only the WLAN card to 1500. This is done with

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{65FA9572-A7DB-42EE-8EC5-1D1D41E299FA}\MTU: 0x000005DC

So therefore I need to find this {65FA9572-A7DB-42EE-8EC5-1D1D41E299FA} value so I get the correct registry string for my WLAN NIC.

Its not really nice way to do this through registry - you can use command

Wmic nicconfig set SetMTU

instead

  • Author

Hmm never heard of that method, can you explain how I can set MTU to 1500 on only one specific NIC?

Edited by BoardBabe

How about using AutoIT?

Check out the RegEnumKey, RegEnumVal, RegRead, RegWrite functions.

They should be able to do what you are looking to do.

Study WMIC, it is really awesome command...

You can use "where", so you can select only one NIC... For example

WMIC NicConfig Where Description="Broadcom NetXtreme" Set SetMTU = 1500

The "HowTo" is simple. Run command

Wmic NicConfig list full

Find your NIC and find unique settings that it contains... Thats all.

  • Author

@Joe User 99: AutoIt is oute of the question ;)

@Martin Zugec: I'll try look into this command. Looks interesting, but whats the benefit over regedit it?

hmm Im trying your command, but all i get is an error code 0x80041002.

Edited by BoardBabe

Simple - no need for identificators etc... And the main reason is that when you know syntax of WMIC, you can access ANYTHING (really :))

  • Author

Ok, It sounds like a good idea if I can just get it working.

I tried with Description = ... but didnt work so then i tried with MAC, but I still get an error and cant set MTU. is this line correct?

WMIC NicConfig Where MACAddress="00:0E:35:2C:20:A7" Set SetMTU = 1500

  • Author

Sorry still nothing :( Ive tried numerous ways, but I cant get it working, but it seems like the perfect thing for my use if I can get it correct...

This however works to GET MTU, but I cant figure out the correct way to SET MTU

CWMIC NicConfig Where Description="Intel(R) PRO
/Wireless 2200BG Network Connection - Miniport for pakkeplanlegger" GET MTU

displays:

MTU
1500

Can you try set your mtu with WHERE and see if you get it working?

Edited by BoardBabe

  • 4 months later...
Study WMIC, it is really awesome command...

hi, is there a way to set registry keys using wmic?!

one can do really amazing stuff with the wmic commands, but i don't find a possibility to edit/create/delete reg.keys.. maybe someone could help me.

thx in advance

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.