Windows 使用cmd oneliner获取存储的WiFi网络

Windows 使用cmd oneliner获取存储的WiFi网络,windows,cmd,Windows,Cmd,我希望以单行命令(不是从批处理中)运行此命令,但无论我如何尝试,都无法成功: (对于/f“tokens=2 delims=:”%%a in('netsh wlan show Profile^ | findstr“Profile”)do( set str=%%a set str=!str:~1! 回声!str! ))>>wifi_networks.txt使用批处理文件时,您可以将%翻一番,因为您没有这样做,它们应该再次返回到single 试试这个(未经测试): (For/F“Tokens=2De

我希望以单行命令(不是从批处理中)运行此命令,但无论我如何尝试,都无法成功:

(对于/f“tokens=2 delims=:”%%a in('netsh wlan show Profile^ | findstr“Profile”)do(
set str=%%a
set str=!str:~1!
回声!str!

))>>wifi_networks.txt
使用批处理文件时,您可以将
%
翻一番,因为您没有这样做,它们应该再次返回到single

试试这个(未经测试):

(For/F“Tokens=2Delims=:%A In('NetSh WLAN Show Profiles^ | Find“Profile”')Do@For/F“Tokens=*Delims=“%B In(“%A”)Do@Echo%B”)>>“wifi_networks.txt”

如果
wifi\u networks.txt
不存在,您可以将
>
更改为

谢谢!很好用!