I am very new to batch scripting and have to use console to interrogate Registry for network profile description and output only the description data to a txt file. I am usi
Here is an quick example which should output a file providing each GUID and Description alongside your running script.
@Echo Off
SetLocal EnableExtensions DisableDelayedExpansion
(Set k=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles)
For /F "Delims==" %%A In ('Set GUID[ 2^>Nul') Do Set "%%A="
Set "i=101"
For /F "EOL=E Tokens=1,2*" %%A In ('Reg Query "%k%" /S /V Description') Do (
If "%%~nB" NEq "%%~B" (Call Set "GUID[%%i:*1=%%]=%%~nB") Else (
Call Call Set GUID[%%i:*1=%%]="%%%%GUID[%%i:*1=%%]%%%%","%%C"
Set/A i+=1))
If %i% NEq 101 (>"%~dp0NetProfs.log" 2>Nul Set GUID[)
EndLocal
Exit/B
You will probably need to right-click and run as Administrator due to resrictions on those keys.