[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

XP Command help with reg import and renaming item

In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\EAPOL\Parameters\Interfaces\{259068B4-2BFE-4EEE-A682-0C4EF7FDF41C}
The profiles are listed in numerical order.

How can I delete any existing Registry entry in this key above that contain the word "NetworkName2" in the REG_BINARY data?

The number list order could be anything from 1 - 99, and I don't want to delete other wireless networks.

Here's where it's at when you double-click the REG_BINARY item, as you can see there's a "Networkname2" listed in there:
screenshot
0
garryshape
Asked:
garryshape
  • 7
  • 4
  • 2
1 Solution
 
John HurstBusiness Consultant (Owner)Commented:
Those registry entries are there to be used (and sometimes over again) on most operating systems from XP forward.

Why do you need to delete keys being used?  You could do some damage. They should not be causing any problems.
0
 
garryshapeAuthor Commented:
Because I'm trying to deploy a wireless profile that uses PEAP authentication, and after importing, I need to replace the registry entry in this key that is generated when the wireless profile is imported via a third party utility.

Back-story:

This is a target of Win XP Embedded systems, all the same computer models, and I'm trying to deploy a wireless network profile to the computers that connects to a wireless network using PEAP.

The challenge is that netsh wlan commands are not available in this XPE environment, so I cannot export/import with netsh.

So that leads me to use this Symantec Wifi tool that exports wireless profiles to XML (http://www.symantec.com/connect/articles/how-capture-and-deploy-wlan-profiles).
 
However, Symantec's tool will not export a wireless profile if PEAP is selected in Authentication, as you'll read on that article's comments section.

So, what I've done is, per one of the comments in that article, for exporting:
1. Exported the REG key entry of the wireless network while it is configured how I like.
2. Edited the .reg file in Notepad, leaving only the Entry that contains the "Networkname2" in the item data, which has all the encrypted setting info on PEAP authentication, etc.  
3. Then I changed the wireless to something besides PEAP so that the Symantec Wifi tool could export the wireless profile to XML. Now I have my Symantec wifi export xml of this wireless profile.

Then, for importing to another computer, I must now do the following:
1. Use the Symantec wifi tool to import -- problem
2. Wifi profile is now imported, but it doesn't have the right settings I want.
3. I then import the .reg file I exported in the exporting steps, but now this is a duplicate entry with a different number, and Windows is not reading this reg entry for the wireless network with the same name.

So I either need to somehow delete the other one, or overwrite it upon importing the registry.
0
 
John HurstBusiness Consultant (Owner)Commented:
There is more than one place for this key. Did you get all the places?  This is dangerous work.

If you can find all the right places (depends on machine) then overwriting the values is probably the best choice.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
garryshapeAuthor Commented:
I'll search some more but I'm not finding what other places in the registry are relevant to this key's entry.
I just know that manually, if I import the .reg file, it adds the new entry. And my wireless is still not setup right.
But if I delete the generated reg entry, leaving the imported one (which contains the same wireless network name as the  generated one I deleted), my wireless settings are all better now and configured properly, functioning just fine.
So I'm just trying to automate this without having to use the registry GUI
0
 
John HurstBusiness Consultant (Owner)Commented:
Try using the wireless setup tool to set it up. Much more reliable.

The registry is not a user tool for this use (I did read your reasoning). There are multiple sections for the same thing and not all done in the same way.

Good luck with this and I hope you do not hose the machines.
0
 
garryshapeAuthor Commented:
The wireless setup tool doesn't work for a hundred users running a slimmed, locked-down XP Embedded thin client system. The systems will definitely get messed up relying on users, and I can't run around to every machine doing it.

The alternative to this is a GUI-automated method I have created in AutoIT, which uses the Aruba wifi tool to remove ssid network profiles, then handles the opening of ncpa.cpl, opening the wireless applet, adding in the network through ControlClick's, etc.
But that still brings up interruption to the Explorer interface for end-users.

For GPO methods, I've got the Wireless network implemented for Windows 7 machines just fine.
0
 
John HurstBusiness Consultant (Owner)Commented:
You need to look in Control Set, all the Control Set backups (at least 2) and all the locations that hold the hardware.

Again, good luck.
0
 
oBdACommented:
Try if this works for you then; note that "Networkname2" has to be written exactly as it is (not "NeworkName2",  "networkname2", or "Network name 2"), matching the value in the screenshot, not in your question. The script is in test mode and will only echo out the "reg delete" command it would normally run, so that you can test it. Remove the uppercase ECHO in line 14 to run it for real:
@echo off
setlocal enabledelayedexpansion
REM *** "Networkname2" in binary format; the string (not the hex) is CaSe SeNsItIvE!
set FindBinary=4E6574776F726B6E616D6532
set EapolKey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\EAPOL\Parameters\Interfaces\{259068B4-2BFE-4EEE-A682-0C4EF7FDF41C}
echo Analyzing '%EapolKey%':
for /f "tokens=1,2*" %%a in ('reg.exe query "%EapolKey%" ^| find "REG_BINARY"') do (
	echo Index '%%a' ...
	echo %%c|find /i "%FindBinary%" >NUL
	if errorlevel 1 (
		echo ... not found.
	) else (
		echo ... found; removing ...
		ECHO reg.exe delete "%EapolKey%\%%a" /f
	)
)

Open in new window

0
 
garryshapeAuthor Commented:
@oBdA

Thanks for the feedback. It looks like that's getting somewhere.
It will echo if found but if I remove the ECHO to leave the reg.exe....etc like you advised, it will say "Error:  The system was unable to find the specified registry key or value".

Do you know what else I might have to change to fix that?

Also is there a way, that once it's found, to store that 1 particular reg entry as a variable, import a reg that contains the same Binary value hex (wireless name) in it, then delete the saved variable entry, leaving the other entry?
0
 
oBdACommented:
Sorry, this corrects the deleting issue:
@echo off
setlocal enabledelayedexpansion
REM *** "Networkname2" in binary format; the string (not the hex) is CaSe SeNsItIvE!
set FindBinary=4E6574776F726B6E616D6532
set EapolKey=HKEY_LOCAL_MACHINE\SOFTWARE\Acme\EAPOL\Parameters\Interfaces\{259068B4-2BFE-4EEE-A682-0C4EF7FDF41C}
echo Analyzing '%EapolKey%':
for /f "tokens=1,2*" %%a in ('reg.exe query "%EapolKey%" ^| find "REG_BINARY"') do (
	echo Index %%a ...
	echo %%c|find /i "%FindBinary%" >NUL
	if errorlevel 1 (
		echo ... not found.
	) else (
		echo ... found; removing ...
		ECHO reg.exe delete "%EapolKey%" /v "%%a" /f
	)
)

Open in new window

But you've lost me withe the storing and deleting. Why would you want to store the entry first, then import something else, and then delete the stored variable? The result shouldn't be any different from first deleting and then importing.
0
 
garryshapeAuthor Commented:
Ok thanks I will try

Sorry for the confusion, the reasoning is:

1. The reg entry I'm deleting is one that has the correct wireless network SSID in it, but doesn't have the right settings for other things about the wireless profile, such as PEAP authentication settings, etc.
2. The reg entry I'm importing, has the same wireless network SSID as the one I deleted, but it contains the correct wireless profile settings that are required.

So after the wireless network is imported with a third-party executable, Windows XP automatically itself generates a registry entry in that key, say, index 3. Index 3 entry has the right wireless SSID in the binary data, but the wrong settings.
Now when I import the .reg export from another computer where I had the right wireless settings, now we have an Index 4 reg entry, which is the entry with the correct settings.

So when I run the script, instead of just deleting the useless Index 3 entry, it's going to also delete Index 4.

I had to export the reg of the wireless because, with the third-party Wireless profile backup utility, it would not export the wireless profile due to PEAP settings being in place. So I had to export the reg with the peap settings in place, change the wireless to remove PEAP, and THEN the third-party utility would backup the wireless profile.

So that's why I now have to import with the third party wireless utility, import the .reg file containing the right settings for the wireless profile, then delete the reg entry that contains the invalid settings.
0
 
garryshapeAuthor Commented:
Actually, it looks like I can import the reg file after deleting the key registry entries and it continues to work. let me try to get it all together and try again on another system
0
 
garryshapeAuthor Commented:
Thanks, so so much. Works like a charm.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now