# Windows batch file or script to load exported Wi-Fi XML profiles onto a new laptop

This probably is as simple as reconfiguring the standard code used by MS for the same thing but .. I hope maybe someone has already done it.
You can easily export a Wi-Fi profile to a USB including all necessary parts to import in new laptop so that Wi-Fi profiles are preloaded. But as far as I can tell, I have to run it one for each profile. Which is OK to create them.

Better yet, if the script could delete itself after it runs then I won't have to worry about anyone I don't know popping in on the Wi-Fi.

Any suggestions appreciated. Getting the XML's is easy and I have found a number of other Free software that do a lot more but this is the only single part of my life that is pure misery as I get chewed out for being "security proactive" if the people I send the XML's to (with instructions) still can't load them.

-

After exporting a profile in XML format, you can import it on another PC using the following command:

netsh wlan add profile filename="Drive:\Path\to\profile.xml"


You can also specify an interface to import the profile; this option is useful if the computer has multiple wireless adapters. You can also specify that you want to apply the profile to all users of the computer, or just to the current user. For example:

netsh wlan add profile filename="Drive:\Path\to\profile.xml" interface="Wireless Network Connection" user=current


If you don't specify an interface, Windows adds it for all interfaces by default. Also, if you don't specify the user parameter, Windows adds the profile for all users.

You can add these commands to a batch file, that executes them and then deletes both the XML and itself.

If you need an EXE, you'll have to use some other method (or look into some "Batch to EXE" type programs). As for the keys, unless you explicitly use key=clear while exporting the profile using netsh, the XML file will include encrypted keys.

-
Read through this you may find a break through David's blog and ITninjaBlog –  Harbinder Singh Jun 18 at 9:07