In addition, you can consider exporting the link as a hyperlink in the output, and the output file as an HTML file.
Getfavorites.vbs:
Copy Code code as follows:
'===================================================================
Const FAVORITES = &H6&
Const ForWriting = 2
Set Objshell = CreateObject ("Shell.Application")
Set objfolder = Objshell.namespace (FAVORITES)
Set fso = CreateObject ("Scripting.FileSystemObject")
Processget objfolder
Set objfolder = Nothing
Set FSO = Nothing
Wscript.Quit
'===================================================================
Sub Processget (objfolder)
For each objitem in objFolder.Items
If Objitem.islink Then
Set Objlink = Objitem.getlink
WScript.Echo objItem.Name
WScript.Echo Objlink.target
Set Objlink = Nothing
ElseIf Objitem.isfolder Then
Processget Objitem.getfolder
Else
Exit for
End If
Next
End Sub
'===================================================================
Getfavorites.bat:
Copy Code code as follows:
cscript.exe C:\vbs\Getfavorites.vbs >c:\vbs\getfavorites_result.txt
Pause