Save this script as a batch file (e.g., list_network_drives.bat ) and run it in Command Prompt.
:: Using net use net use
net use > network_drives.txt
This command uses the Windows Management Instrumentation Command-line (WMIC) to retrieve a list of network drives. cmd network drive list