eBase6.com

knowledge of computers and related technologies


Share data between user accounts using directory junctions

Summary

One of the least documented and probably, least known, features of Microsoft Windows is its ability to create junction points. In this article, not only will you learn what these are but will also learn one of their uses that can prove really helpful if data from one application needs to be shared between user accounts on Windows.

Junction Points: Brief Introduction

Junction Points is a NTFS file system only feature that provides the ability to create a seamless link to a target directory on the local volume. The word "seamless" is used because, the link created looks exactly like the folder it is linked to.

For example, let's say you have a folder Folder1 which contains a file named file1.txt. If a junction point with the name JP1 is created to Folder1, then browsing to JP1 will display a file file1.txt. The point here is that JP1 will behave just like a regular folder and file1.txt will appear as if it belongs to JP1 itself although it actually exists under Folder1.

Creating/Deleting Junction Points

Although the recent versions of Windows operating systems provide an in-built command-line tool called mklink, we recommend downloading and using a small utility called Junction created by Mark Russinovich.

Let's delve into the details of how to create and delete junctions. At the same time, you will learn how to benefit from this functionality by allowing to share data from one application between user accounts.

Share data using junction points

Most of the applications store their configuration data in the Application Data folder of the currently logged-in user. This allows different users on the computer to have different application settings. What if you want to share configuration data from one application between user accounts? Let's see how.

As an example, say you have the torrent client Azureus installed on your computer. Also assume you have two user accounts on your computer — Administrator and User1. To share application settings from Azureus between these accounts, make sure Azureus is not running and then, do the following:

  1. Log in to your computer as Administrator.
  2. Depending on your operating system, navigate to one of the following folders:
    • Windows XP / Windows 2000: C:\Documents and Settings\User1\Application Data\
    • Windows Vista / Windows 7: C:\Users\User1\AppData\Roaming\
  3. Under this folder, you will see a sub-folder Azureus; rename it to Azureus (Backup).
  4. Open command prompt, type cd «application data» and then, press ENTER key. Replace «application data» with the same folder described in Step 2.
  5. Now, type junction Azureus %AppData%\Azureus and then, press ENTER key.

That's all to it. The next time you log in as User1 and start using Azureus application, it will read it's configuration data from the common path we recently set up. No changes are required in the application's settings because as far as the application is concerned, it's still reading and writing its data to the currently logged-in user's Application Data folder. Junction point we've created is transparent to the application.

One Last Note: The user, in whose profile the junction point is created, must have read/write permission to the folder the junction point is linking to.

Deleting a Junction Point

To delete a junction point at any point:

  1. Open command prompt and change the current directory to the folder in which the junction point exists.
  2. Type junction -d «junction point»
    where, «junction point» is the name of the junction point you want to delete.
  3. Press ENTER key and the junction point would be removed without affecting the actual folder the junction point was linking to.


Comments

Comments Powered By Disqus
Rating
Average: Not Rated
You rated: Not Rated
Tags


Views
This week: n/a
Total views: 796
Comments
Total: 0
License
 

Copyright © 2010 eBase6.com. All rights reserved.