Step1: create a text file in C:\ drive or your preferred drive and name it like switch-config.txt or your preferred name.
Step2: open command prompt and type as follows
Telnet –F c:\switch-config.txt IP-Address-of-switch
provide privilege password
#Terminal Length 0
#show vlan brief
Now you can exit from telnet and go to c:\ drive and open switch-config.txt to view switch/router config.