Just need a little help optimizing some code if possible(?) Thanks.
-------------------------------------------------------------------------
Code: Select all
@echo off
echo.
echo.
echo Details of locally stored networks...
echo.
if exist %userprofile%\desktop\%username%.txt del %userprofile%\desktop\%username%.txt
for /f "tokens=5-7 skip=4" %%g in ('netsh wlan show profiles') do (
netsh wlan show profiles name="%%g %%h %%i" key= clear | findstr "name Authentication key Content">>%userprofile%\desktop\%username%.txt)
for /f "tokens=5-7 skip=4" %%g in ('netsh wlan show profiles') do (
netsh wlan show profiles name="%%g %%h" key= clear | findstr "name Authentication key Content">>%userprofile%\desktop\%username%.txt)
for /f "tokens=5-7 skip=4" %%g in ('netsh wlan show profiles') do (
netsh wlan show profiles name="%%g" key= clear | findstr "name Authentication key Content">>%userprofile%\desktop\%username%.txt)
type %userprofile%\desktop\%username%.txt
echo.
echo Saved to %userprofile%\desktop\%username%.txt...Keep y/n ?
set /p ch=
if %ch%==y exit
if %ch%==n del %userprofile%\desktop\%username%.txt
exit
Basically, how do I allow for multiple words in the SID without having to run the same command for each possible amount?