I am trying to create XML files for each of the wireless networks on my computer, containing their passwords, in a general solution (without knowing the exact names of each network) as shown here: Netsh WLAN Commands for Windows 10 – Here’s a Full Tutorial! in the "Export and Import Wireless Profile" section.

Using the command they suggest (which I've seen in other places as well)

netsh wlan export profile folder=c:\ key=clear

I receive the following error:

The filename, directory name, or volume label syntax is incorrect.

I have tried saving it to another folder, both in the C and D drives and neither have worked. If I add "name=profileName" with the name of an existing profile it creates an XML file for that specific profile, but I want to create XML files for each network considering I won't know their names.

Is there another way I can to that, or something I can do to fix what's causing this problem? Thank you in advance to any helpers, I appreciate your time!

  • The cmd is already in administrator mode
1

There are 1 best solutions below

1
On BEST ANSWER

In order to get the names of your individual profiles, you can run the command NetSh WLAN Show Profiles. If you do that within a , you can extract the profile names and inject those into the NetSh WLAN Export Profile Name="<ProfileName>" Key=clear Folder=C:\ command.

In , (i.e. the Command Prompt 'Run as administrator'), the following command line may do that for you:

For /F "Tokens=1,* Delims=:" %G In ('%__AppDir__%netsh.exe WLAN Show Profiles 2^> NUL ^| %__AppDir__%findstr.exe /RC:" : [^ ]"') Do @For /F "Tokens=*" %I In ("%H") Do @%__AppDir__%netsh.exe WLAN Export Profile Name="%I" Key=clear Folder=C:\