Create Symbolic Links, Hard Links and Directory Junctions in Vista with MKLINK創建符號鏈接,硬鏈接和目錄路口,在Vista與mklink

For Unix-like or Linux system users, symbolic link is a common feature in use almost daily.為Unix的一樣,或Linux系統的用戶,符號鏈接的一個共同特點是在使用中幾乎每天都有。 Symbolic link (aka soft link) or symlink as it often shortened to, is a special type of file or file-system object that serves as a reference or points to another file, UNC or directory, known as target.符號鏈接(又名軟鏈接)或符號連結,因為它往往縮短,是一種特殊類型的文件或文件系統的對象提供了一個參考或點到另一個文件,聯合國軍司令部或目錄,被稱為目標。 In Windows Vista, symlinks feature has been added to NTFS filesystem and can be created by using MKLINK command.在Windows Vista中,符號連接的功能已添加到NTFS的文件系統和可以創造出用mklink指揮。 In previous Windows operating system, the closer thing to symbolic links is NTFS junction point, or worse, Windows shell shortcut (.lnk) file.在以往的Windows作業系統,更密切的事,符號鏈接是NTFS交界點,或更糟的是, Windows Shell中的捷徑( 。 lnk )文件。

Symlink in Vista, unlike .lnk shortcut in desktop or Windows Explorer, allow user to access files within the symbolic link created itself via explorer, the console and etc. And symbolic link also differ from NTFS junction point which can only link to folders and volumes, in which symlinks can point to a file, a UNC, a folder or a volume, as well as able to span file systems.在Vista中的符號連接,不像。 lnk快捷方式在桌面或Windows檔案總管中,允許使用者存取檔案內的符號鏈接,創造本身通過Explorer中,控制台等和符號鏈接,也不同於NTFS的交界點,只能鏈接到的文件夾和卷,在這種符號鏈接可以指向一個文件,一個UNC ,一個文件夾或卷,以及能夠跨度檔案系統。

Symbolic link is useful when you have a lot of folders and files are scattered all over the directory tree, and you need to manage them from a single location.符號鏈接是有用的當您有很多的文件夾和文件,分散在各地的目錄樹,並且您需要管理,他們從一個單一的位置。 Another scenario is that you have a deep nested file that you want to access quickly instead of traverse through one branch by one branch.另一種情況是,你有深刻的巢式文件,您要訪問的快速而不是導線通過一科一科。 And furthermore, for programmer, symlink provides a static file path that can be point to a ever changing object without affecting the functionality of the program.此外,為程序員,符號連接提供了一個靜態的文件路徑,可以指向一個不斷變化的對象在不影響功能的程式。 In all these situation, symbolic links can be created at a convenient location which point to the ‘real’ objects.在所有這些情況下,象徵性的聯繫,才能創造一個方便的位置,這點'真正的'對象。

As mentioned, to create a symbolic link, use MKLINK command line tool.如上所述,創建一個符號鏈接,使用mklink命令行工具。 MKLINK can be used to create a hard link or directory junction too. mklink可以用來創建一個硬鏈接或目錄的交界處。 Hard link is essentially giving another name or label to the objects, while NTFS directory junction point is used to redirect the whole folder to another folder as if it’s the original folder itself.硬鏈接,基本上是給另一個名稱或標籤的對象,而NTFS目錄交界點是用來重定向整個文件夾到另一個文件夾,因為如果它的原始文件夾本身。 Junction point is used extensively in Vista to provide support for old directory structures for user profiles (ie Documents and Settings) to point to the new user folders located inside Users directory.交界點是廣泛使用在Vista中提供支持的舊目錄結構為用戶配置文件(即文件和設置)以指向新的用戶文件夾內的用戶目錄中。

Syntax and Options of MKLINK 語法和選擇mklink

MKLINK [[/D] | [/H] | [/J]] Link Target mklink [ / ] | [ /小時] | [ / j ]鏈接目標

/D - Creates a directory symbolic link. / -創建一個目錄的符號鏈接。 Default to file symbolic link.默認文件符號鏈接。
/H - Creates a hard link instead of a symbolic link. /小時-創建一個硬鏈接而不是一個符號鏈接。
/J - Creates a Directory Junction. / j -創建一個目錄交界處。
Link - Specifies the new symbolic link name.鏈接-指定新的符號鏈接的名字。
Target - Specifies the path (relative or absolute) that the new link refers to.目標-指定的路徑(相對或絕對)說,新的聯繫是指。

Examples and Usages of MKLINK 例子和用法mklink

Note: Only Administrators can use MKLINK to create symbolic links unless override by using secpol.msc, so you need to run Command Prompt with elevated privileges, or else you will get “You do not have sufficient privilege to perform this operation.” error.注意:只有管理員可以使用mklink創建符號鏈接,除非凌駕使用secpol.msc ,所以你需要運行命令提示符以提升的權限,否則,你會得到“您沒有足夠的權限執行此操作。 ”錯誤。

To create symbolic link called foo to reference to c:\Windows\System32\notepad.exe:創建符號鏈接名為foo參考到C : \的Windows \ system32 \記事本:

C:\test>mklink foo c:\Windows\System32\notepad.exe為C : \測試> mklink富為C : \的Windows \ system32 \記事本

You will see the following result:您會看到下面的結果:

symbolic link created for foo <<===>> c:\Windows\System32\notepad.exe象徵性的聯繫創造了富<<===>>為C : \的Windows \ system32 \記事本

If you type dir in commnd prompt, you will see the following listing:如果您鍵入dir在commnd提示符下,您會看到下面的名單:

Volume in drive C has no label.貨量在驅動器C並沒有標籤。
Volume Serial Number is 2211-7428卷序號是2211-7428

Directory of C:\test目錄為C : \測試

04/14/2006 11:24 AM <DIR> . 2006年4月14日上午11時24分<dir> 。
04/14/2006 11:24 AM <DIR> .. 2006年4月14日上午11時24分<dir> ..
04/14/2006 11:24 AM <SYMLINK> foo [c:\Windows\system32\notepad.exe] 2006年4月14日上午11時24分<symlink>富[為C : \的Windows \ system32 \記事本]
1 File(s) 0 bytes 1檔( ) 0字節
2 Dir(s) 69,238,722,560 bytes free二迪爾( ) 69,238,722,560字節免費

To create symbolic link to a folder, simply use /D switch:創建符號鏈接到一個文件夾,只需使用/ d開關:

C:\test>mklink /d bar c:\windows為C : \測試> mklink /酒吧為C : \的Windows
symbolic link created for bar <<===>> c:\windows符號鏈接,創造酒吧<<===>>為C : \的Windows

Results of dir command:結果dir命令:

Volume in drive C has no label.貨量在驅動器C並沒有標籤。
Volume Serial Number is 2211-7428卷序號是2211-7428

Directory of C:\test目錄為C : \測試

04/14/2006 11:24 AM <DIR> . 2006年4月14日上午11時24分<dir> 。
04/14/2006 11:24 AM <DIR> .. 2006年4月14日上午11時24分<dir> ..
04/14/2006 11:24 AM <SYMLINKD> bar [c:\windows] 2006年4月14日上午11時24分<symlinkd>酒吧[為C : \的Windows ]
04/14/2006 11:24 AM <SYMLINK> foo [c:\Windows\system32\notepad.exe] 2006年4月14日上午11時24分<symlink>富[為C : \的Windows \ system32 \記事本]
1 File(s) 0 bytes 1檔( ) 0字節
3 Dir(s) 69,238,722,560 bytes free三迪爾( ) 69,238,722,560字節免費

MKLINK cannot use to delete symbolic link. mklink不能使用刪除符號鏈接。 To remove a symbolic link, simply delete them as if you’re removing a normal file.要刪除一個符號鏈接,只需刪除它們,因為如果您刪除一個正常的文件。 For example, to delete the foo symbolic link created above, enter the following command:例如,要刪除富象徵性的聯繫創造了上述情況,輸入以下命令:

C:\test>del foo為C : \測試>刪除富

To remove the bar symbolic link to a folder created above, use the following command:刪除酒吧符號鏈接到一個文件夾中創建以上,使用下列命令:

C:\test>rd bar為C : \測試>路酒吧

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明 :這是一個機器翻譯網頁是“按原樣”提供的擔保。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article原來的英語文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at分享和貢獻,或取得技術的支持和幫助,在 My Digital Life Forums 我的數字生活論壇 .



4 Responses to “Create Symbolic Links, Hard Links and Directory Junctions in Vista with MKLINK” 4回應“創建符號鏈接,硬鏈接和目錄路口,在Vista與mklink ”

  1. The CTRAN weblog » Blog Archive » Create Symbolic Links, Hard Links and Directory Junctions in Vista with MKLINK該ctran博客»博客存檔»創建符號鏈接,硬鏈接和目錄路口,在Vista與mklink
    June 2nd, 2007 04:22 2007年6月2日4時22分
    1

    [...] Create Symbolic Links, Hard Links and Directory Junctions in Vista with MKLINK » My Digital Life: [...] [ … … ]創建符號鏈接,硬鏈接和目錄路口,在Vista與mklink »我的數字生活: [ … … ]

  2. david國寶
    June 23rd, 2008 09:36 2008年6月23日9時36分
    2

    I cannot figure out how to go to or switch to a symbolic link after it is created.我不能弄清楚如何去或切換到一個符號鏈接後,這是創建。 How do you do it?你怎麼做呢? I can’t find instructions for this mentioned anywhere.我無法找到的指示,這在任何地方提及。

  3. Ed教育署
    June 25th, 2008 06:32 2008年6月25日6時32分
    3

    Thanks for the post, but I don’t see the point of creating a symlink to a file.感謝後,但我不明白的出發點,創造一個符號鏈接到一個文件。 In your example, you created a symlink called “foo” pointing to notepad.exe, but what can you do to the file “foo”?在您的例子,您創建了一個符號連結所謂的“富”指出,記事本,但可以做什麼,以檔案“富” ? It’s not executable, even after I rename it to foo.exe.它不是可執行文件,甚至後,我將它重新命名為foo.exe 。

    Thanks.謝謝。

  4. ludo
    July 22nd, 2008 17:39 2008年7月22日17時39分
    4

    you can’t execute symlinks, for that you need to make a shortcut the normal way.你無法執行的符號連接,你需要作一個捷徑循正常途徑。 A symlink is more usefull for ppl to read a certain file wich is in a folder they normaly can’t go to.一個符號鏈接是更有益的脂肪酶讀某一個文件,該文件是在一個文件夾中,他們normaly不能去。 Or the same file is needed on 2 different folder locations, but you dont want to edit 2 seperate files all the time.或相同的檔案,需要2個不同的文件夾的位置,但您不想要編輯的二單獨的文件中的所有時間。

Leave a Reply離開的答复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用這些標籤:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <刪除日期時間= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting訂閱無評論


Custom Search

New Articles新的條款,

Incoming Search Terms for the Article傳入的搜索條件文章

mklink mklink - - vista hard link Vista的硬鏈接 - - mklink vista mklink Vista的 - - mklink download mklink下載 - - vista hard links Vista的硬鏈接 - - vista create junction Vista中創造的交界處 - - vista Hardlink Vista的hardlink - - download mklink 下載mklink - - vista mklink Vista的mklink - - vista create link Vista的建立連結 - - vista junctions Vista的路口 - - vista directory link Vista的目錄鏈接 - - hard link vista Vista的硬鏈接 - - mklink remove mklink刪除 - - remove symbolic link 刪除符號鏈接 - - remove symbolic link vista 刪除符號鏈接, Vista的 - - mklink junction mklink交界處 - - hard links vista Vista的硬鏈接 - - create junction vista 創建Vista的交界處 - - create link vista 建立連結Vista的 - - mklink syntax mklink語法 - - remove mklink 刪除mklink - - delete mklink 刪除mklink - - windows vista hard links Windows Vista的硬鏈接 - - mklink hard link mklink硬鏈接 - - MKLINK mklink - - vista create hard link Vista的創建硬鏈接 - - create hard link vista 創建硬鏈接Vista的 - - all 全部 - - create symbolic link vista 創建符號鏈接, Vista的 - - vista remove symbolic link Vista中移除符號鏈接 - - windows vista hard link Windows Vista的硬鏈接 - - vista make link Vista中作出的聯繫 - - mklink you do not have sufficient privilege to perform this operation mklink您沒有足夠的權限執行此操作 - - mklink windows xp mklink的Windows XP - - how to use mklink 如何使用mklink - - mklink delete mklink刪除 - - link folder vista Vista的文件夾鏈接 - - mklink privileges mklink特權 - - vista directory links Vista的目錄鏈接 - - create ntfs junction vista 創建NTFS的交界處Vista的 - - delete junction vista 刪除Vista的交界處 - - vista mklink privileges Vista的mklink特權 - - hard link directory 硬鏈接目錄 - - hard link windows vista 硬鏈接的Windows Vista - - symbolic link Vista Vista的符號鏈接 - - vista junction create Vista的交界處建立 - - vista delete symbolic link Vista的刪除符號鏈接 - - junction mklink 交界mklink - - remove symlink vista 刪除Vista中的符號連接 - -