Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Using netsh, I used the following command to add a wireless profile

add profile filename="c:\profiles\DLINK-Profile.xml" interface="D-Link DWA-125 N150"

All parameters are valid. But I get the error "An attempt was made to load a program with an incorrect format."

I know this error is related to OS architecture 64bit or 32 bit. But i'm not sure which program is not compatible.

I'm using Win7 64bit

share|improve this question

3 Answers 3

In the XML file, check the value in <keyMaterial></keyMaterial> for the following characters and replace accordingly:

"   -> &quot;
&   -> &amp;
'   -> &apos;
<   -> &lt; 
>   -> &gt;

For example, if your WiFi passphrase is listed as P@ssw0rd&123, replace it with P@ssw0rd&amp;123

XML sees the above predefined entities as markup and breaks the ability of the netsh command to parse the XML file properly.

share|improve this answer

It should be something like this:-

netsh wlan add profile filename="PATH_AND_FILENAME.xml" Interface="Wireless Network Connection" user=current

Refer Importing and Exporting Windows Network Settings for more info

share|improve this answer

I was getting the same error with this command, and in my case, it turned out to be an extremely misleading error message. It was an issue with the format of the XML profile file I was using, not any kind of CPU architecture mismatch.

Specifically, if you're basing your profile on the examples found here, like I was, the examples include the following line:

<?xml version="1.0" encoding="US-ASCII"?>

Try removing that line — once I did, it solved the issue and let me add the profile.

(Expanding on TGT's answer above, it seems that any formatting problem with the XML causes netsh to throw that error. For example, I went in and deleted a few characters from a working profile XML file, so that it wasn't even well-formed XML anymore, and tried to add it. It failed with the same error.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.