@ECHO OFF Title FXR Wireless Profile Information ::Assembled by F1X3R SETLOCAL SETLOCAL enabledelayedexpansion CLS COLOR 0A ECHO. ECHO _/_/_/_/ _/ _/ _/_/_/ ECHO _/ _/ _/ _/ _/ ECHO _/_/_/ _/ _/_/_/ ECHO _/ _/ _/ _/ _/ ECHO _/ _/ _/ _/ _/ ECHO. :LOCALWIFI CLS ECHO Wireless profile names and passphrases found on %computername% ECHO. ECHO Wireless Profile Name Wireless Passphrase ECHO --------------------- ------------------- :: NOTE: extraction is delegated to PowerShell rather than parsed in batch. :: Passwords containing !, %%, ^, &, or other cmd/delayed-expansion special :: characters were previously getting truncated or corrupted; PowerShell :: string handling has no equivalent problem. powershell -NoProfile -ExecutionPolicy Bypass -Command ^ "$profiles = (netsh wlan show profiles) | Select-String 'All User Profile\s*:\s*(.+)$' | ForEach-Object { $_.Matches.Groups[1].Value.Trim() }; foreach ($p in $profiles) { $keyLine = (netsh wlan show profile name=\"$p\" key=clear) | Select-String 'Key Content\s*:\s*(.*)$'; $pwd = if ($keyLine) { $keyLine.Matches.Groups[1].Value } else { '(none)' }; '{0,-35} {1}' -f $p, $pwd }" ECHO. ECHO. PAUSE GOTO END :END ENDLOCAL CLS COLOR TITLE Command Prompt EXIT /B 1