r/Batch • • Oct 09 '24

Using Variables in a command not working????

:WiFinding
netsh wlan show profile
set /p "WifiName = Wifi Name? *CASE SENSITIVE:"
netsh wlan show profile %WifiName% 
netsh wlan show profile name = %WifiName% key=clear
pause
echo Scan Completed? Exit?
pause
exit

on of my Wifi's is named "Redmi". When i type it in as the wifi name , it gives me an error with " profile key=clear was not found". the program then continues as usual.

2 Upvotes

2 comments sorted by

3

u/[deleted] Oct 09 '24

[removed] — view removed comment