WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

File And Folder Extender

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

List Directory Reparse Points

 Keywords:  List Directory Folder Junction Reparse Points fafOpen fafFind GetFileAttributes GetFileAttributesW

Question:

Is there a good way to find Junction point information with WinBatch?

Answer:

Here is a quick and dirty modification of one of the examples in the FAF extender's help file the illustrates one way to obtain the directory reparse points under the 'users' directory on a Windows 8 machine.
#DefineFunction IsReparsePoint(strDir)
   Return DllCall("Kernel32.dll", long:"GetFileAttributesW", lpwstr:strDir) & 1024
#EndFunction

#DefineFunction DirFind(filehandle, strDir )
   handle = fafOpen(strDir, '*', 11)
   While 1
      sFound = fafFind( handle )
      If sFound == '' Then Break
      If IsReparsePoint(sFound) Then FileWrite( filehandle, sFound )
      Else DirFind(filehandle, sFound)
   EndWhile
   fafClose( handle )
#EndFunction


AddExtender('WWFAF44I.DLL', 0, 'WWFAF64I.DLL')
outputfile = DirScript():'Reparselist.txt'
filehandle = FileOpen( outputfile, 'Write')

DirFind(filehandle,'c:\users')

FileClose( filehandle )

Run( outputfile, '' )
A list of shell links could be obtained using the extender to search for '.lnk' files.
Article ID:   W18511
Filename:   List Directory Reparse Points.txt
File Created: 2014:06:19:07:48:32
Last Updated: 2014:06:19:07:48:32