How often have you wanted to have access to the same file from two or more directories (folders)? Of course, it has always been possible to do so via a desktop shortcut (
.LNK) file, and those are good as far as they go, but they hide important information, such as when the file to which they point was last updated.
Frequently, I create a file in one directory, such as the notes associated with an active development project. However, I often need access to the same file from other locations, such as the notes directory associated with a library upon which the project depends. When such a case arose a while ago, I took the opportunity to apply my recently acquired knowledge about how symbolic links work in Windows.
Recent Windows versions, starting with Vista, I believe, include
mklink.exe a command line system utility similar to
fsutil.exe, which predates it by several Windows iterations. Unlike
mklink.exe, the links created by
fsutil.exe break when you save an update, leaving copies of the old version in place of each of is hard links.
Using the code
Do the following.
- Use the File Explorer (Windows Explorer) to navigate to the directory where you created the original file.
- Select (highlight) the original file.
- Use the Copy Path tool on the Home tab to deposit a copy of the fully-qualified file name onto the Windows Clipboard. Since the File Explorer always quotes this string, it is guaranteed to work in a command.
- Navigate to the directory where you want to create the symbolic link.
cmd into the address bar, and press the Enter key. This creates a command prompt window with its working directory set to the directory in the active File Explorer window.
- Enter the following command to create your symbolic link.
mklink [SymLinkName] [AbsoluteSourceFileName]
In the above command:
SymLinkName is the name by which the link will be known in the destination directory. Enter a name and extension, but omit any path.
AbsoluteSourceFileName is the absolute (fully qualified) path to the original file. This is the text that you copied into the clipboard in step 3. Hit Ctrl-V to paste it into the command window.
Following is an example that creates a symbolic link,
Default_Event_Source_ID_Missing.TXT, in directory
F:\Source_Code\Visual_Studio\Projects\WizardWrx_Libs\WizardWrx_NET_API\_NOTES 2019/07/15 11:46:02.34>mklink Default_Event_Source_ID_Missing.TXT F:\Source_Code\Visual_Studio\Projects\GUI_Apps\CountDownClock\NOTES\Default_Event_Source_ID_Missing.TXT
symbolic link created for Default_Event_Source_ID_Missing.TXT <&kt;<===>> F:\Source_Code\Visual_Studio\Projects\GUI_Apps\CountDownClock\NOTES\Default_Event_Source_ID_Missing.TXT
Points of Interest
Though the syntax of
fsutil.exe are almost idetical,
mklink.exe works in any command prompt windows, while
fsutil.exe needs an elevated prompt. Save the elevator for when you need it.
Monday, 15 July 2019 is the publication date.
Tuesday, 16 July 2019, while reviewing changes made by an editor, of which I was just notified by email, it came to my attention that there were a few formatting and typographical errors that escaped my notice yesterday.
Wednesday, 17 July 2019, while reviewing my own changes after they were posted, I found another typographical error, and took the opportunity to clarify that File Explorer is another name for Windows Explorer.
I deliver robust, clean, adaptable, future-ready applications that are properly documented for users and maintainers. I have deep knowledge in multiple technologies and broad familiarity with computer and software technologies of yesterday, today, and tomorrow.
While it isn't perceived as sexy, my focus has always been the back end of the application stack, where data arrives from a multitude of sources, and is converted into reports that express my interpretation of The Fundamental Principle of Tabular Reporting, and are the most visible aspect of the system to senior executives who approve the projects and sign the checks.
While I can design a front end, I prefer to work at the back end, getting data into the system from outside sources, such as other computers, electronic sensors, and so forth, and getting it out of the system, as reports to IDENTIFY and SOLVE problems.
When presented with a problem, I focus on identifying and solving the root problem for the long term.
Specialties: Design: Relational data base design, focusing on reporting; organization and presentation of large document collections such as MSDS libraries
Development: Powerful, imaginative utility programs and scripts for automated systems management and maintenance
Industries: Property management, Employee Health and Safety, Services
Outside Interests: Great music (mostly, but by no means limited to, classical), viewing and photographing sunsets and clouds, traveling by car on small country roads, attending museum exhibits (fine art, history, science, technology), long walks, especially where there is little or no motor traffic, reading, especially nonfiction and thoughtfully written, thought provoking science fiction