1

i trying to query the wifi registry ProfileName under this path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles as Wifi_5G i want to change the profilename to Network_5G. But the folder was not in fixed order example {FB2A1815-B93F-4CF0-A8C8-2CC78D2F98E6}. How can i query which registry folder Profilename = Wif_5G and set it to Network_5G?

This is my code:

SET /P lanuid=Please Enter The Wrong Lan Ethernet Profile Name:
IF "%lanuid%"=="" GOTO Error

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles" /d /f "%lanuid%" /s /e

SET /P lanuid2=Please Enter The Wrong Lan Ethernet UID:
IF "%lanuid2%"=="" GOTO Error

SET /P lanuid3=Please Enter The Correct Lan Ethernet Profilename:
IF "%lanuid3%"=="" GOTO Error


Reg Add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\%lanuid2%" /V ProfileName /T  Reg_SZ /D %lanuid3% /F>Nul
7
  • I think I don't completely understand your question. Do you look for something like for /f "tokens=2 delims={}" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles" /d /f "Wifi_5G" /s /e') do set luid=%%a or for /f "delims=" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles" /d /f "Wifi_5G" /s /e^|find "HKEY_"') do set luid=%%a?
    – Stephan
    Commented Jun 12, 2021 at 8:33
  • @Stephan hi, i am trying to search my wifi name under this name Wifi_5g and change it to Network_5g. however under this location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles the folder is not in proper order it will random create as a different name... i want to do it for few of my users however i realize the folder by default its not the same. different windows will auto generate different folder for eg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\{FB2A1815-B93F-4CF0-A8C8-2CC78D2F98E6}.
    – Eugene Ng
    Commented Jun 12, 2021 at 9:18
  • ok. The first of my suggestions will give you FB2A1815-B93F-4CF0-A8C8-2CC78D2F98E6, the second one HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\{FB2A1815-B93F-4CF0-A8C8-2CC78D2F98E6}. When I understand you correctly, the second one should solve your problem.
    – Stephan
    Commented Jun 12, 2021 at 9:34
  • If you're on Windows 10, why not PowerShell? It's trivial there. $Path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles' ; $ProfileName = 'Wifi_5G' ; $NewName = 'Network_5G' ; gci $Path | ? { $_.GetValue('ProfileName') -eq $ProfileName } | Set-ItemProperty -Name 'ProfileName' -Value $NewName Commented Jun 12, 2021 at 10:24
  • @Stephan bro thank you so much for your help now i manage to change it already.
    – Eugene Ng
    Commented Jun 12, 2021 at 11:51

0

You must log in to answer this question.

Browse other questions tagged .