Wednesday, 9 May 2018

windows 7 - How to view all the Symbolic links,Junction points,Hard links in a Folder using dir?


The command dir /a displays a list of all the files,folders in a given location. But it displays the type for Junction Points as well as Symbolic Links to Folders. Is there any command which will differentiate and tell me which of these are Junction Points and which are Symbolic links as well as which of the files are hard links ?



Answer



Why not use junction.exe from SysInternals? It allows you to list all junctions in a particular folder or its sub folders.


From the website:



Introduction


Windows 2000 and higher supports directory symbolic links, where a directory serves as a symbolic link to another directory on the computer. For example, if the directory D:\SYMLINK specified C:\WINNT\SYSTEM32 as its target, then an application accessing D:\SYMLINK\DRIVERS would in reality be accessing C:\WINNT\SYSTEM32\DRIVERS. Directory symbolic links are known as NTFS junctions in Windows. Unfortunately, Windows comes with no tools for creating junctions—you have to purchase the Win2K Resource Kit, which comes with the linkd program for creating junctions. I therefore decided to write my own junction-creating tool: Junction. Junction not only allows you to create NTFS junctions, it allows you to see if files or directories are actually reparse points. Reparse points are the mechanism on which NTFS junctions are based, and they are used by Windows' Remote Storage Service (RSS), as well as volume mount points.


Please read this Microsoft KB article for tips on using junctions.


Notethat Windows does not support junctions to directories on remote shares.


If you want to view reparse information, the usage for Junction is the following:


Using Junction


Use junction to list junctions:


Usage: [-s]


-s Recurse subdirectories


Examples:


To determine if a file is a junction, specify the file name:


junction c:\test


To list junctions beneath a directory, include the –s switch:


junction -s c:\


To create a junction c:\Program-Files for "c:\Program Files":


C:>md Program-Files


C:>junction c:\Program-Files "c:\Program Files"


To delete a junction, use the –d switch:


junction -d c:\Program-Files



No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...