I have stuck together some code below , please note that there is no error checking so unless you are using this yourself you may want to add some
to use it just create a file called <something>.vbs ( with the <something> as whatever you want to call it ) and then past the code in and run it and it will generate a text file ( c:\output.txt )
it has been pieced together a bit so you may be able to tidy it up and also may want to change the formating as you require
-
-
Option Explicit
-
-
Dim objShell, objFSO, objfile, fileFolder
-
Dim desktopFolder, custFolder, extension, custfile
-
Dim fullname, shortcut, shortTarget
-
-
-
Set objShell = CreateObject("WScript.Shell")
-
Set objFSO = CreateObject("Scripting.FileSystemObject")
-
-
Set fileFolder = objFSO.GetFolder("C:\Documents and Settings\all Users") ' folder to check
-
Set objFile = objFSO.CreateTextFile("c:\output.txt") ' file to output
-
-
Set desktopFolder = objFSO.GetFolder(filefolder & "\Desktop")
-
Set custFolder = desktopFolder.Files
-
-
For Each custFile in custFolder
-
extension = objFSO.GetExtensionName(LCase(custFile.name))
-
If extension = "lnk" then
-
-
'Find full path of shortcut
-
fullname = objFSO.GetAbsolutePathName(custFile)
-
-
'Find full path of target within shortcut
-
'See http://www.devguru.com/Technologies/wsh/quickref/wshshell_CreateShortcut.html
-
'for more information on how this works.
-
-
Set shortcut = objShell.CreateShortcut(fullname)
-
shortTarget = shortcut.TargetPath
-
-
objfile.writeline "File : " & custfile.name & vbcrlf & "Target : " & shorttarget & vbcrlf
-
objfile.writeline "***********************************************************************" & vbcrlf
-
-
End If
-
-
Next
-
-
set objFile = nothing
-
-