在Windows Vista中使用符號鏈接

One of the long-awaited features in Windows Vista was the ability to use symbolic links, the way you can in linux. Sadly, they don’t work quite as well as they could, but it’s a big upgrade from prior versions, and has solved a number of problems for me already.

Windows Vista中人們期待已久的功能之一就是能夠使用符號鏈接,這是在Linux中的一種方式。 令人遺憾的是,它們的運行狀況不盡如人意,但這是對先前版本的重大升級,并且已經為我解決了許多問題。

使用mklink命令 (Using the mklink Command)

The command that you need to use is mklink, which you’ll use from the command line. Just type it on the command line to see the options:

您需要使用的命令是mklink ,您將在命令行中使用它。 只需在命令行上輸入即可查看選項:

C:\Users\geek>mklink
Creates a symbolic link.
MKLINK [[/D] | [/H] | [/J]] Link Target
/D      Creates a directory symbolic link.  Default is a file
symbolic link.
/H      Creates a hard link instead of a symbolic link.
/J      Creates a Directory Junction.
Link    specifies the new symbolic link name.
Target  specifies the path (relative or absolute) that the new link
refers to.
C:\Users\geek>mklink
Creates a symbolic link.
MKLINK [[/D] | [/H] | [/J]] Link Target
/D      Creates a directory symbolic link.  Default is a file
symbolic link.
/H      Creates a hard link instead of a symbolic link.
/J      Creates a Directory Junction.
Link    specifies the new symbolic link name.
Target  specifies the path (relative or absolute) that the new link
refers to.

For instance, if you wanted to make the folder C:\Users\Geek\TestFolder available from C:\TestFolder as well, you could use the following command.

例如,如果您還想使文件夾C:\ Users \ Geek \ TestFolder也可以從C:\ TestFolder使用,則可以使用以下命令。

C:\mklink /D C:\TestFolder C:\Users\Geek\TestFoldersymbolic link created for C:\TestFolder <<===>> C:\Users\Geek\TestFolder

C:\ mklink / DC:\ TestFolder C:\ Users \ Geek \ TestFolders為C:\ TestFolder創建的符號鏈接<< === >> C:\ Users \ Geek \ TestFolder

Now if you look in C:\TestFolder directory, you’ll see whatever files were in the other directory.

現在,如果您查看C:\ TestFolder目錄,您將看到另一個目錄中的所有文件。

了解選項。 (Understanding the Options.)

MKLINK link target

MKLINK鏈接目標

Using the command without any extra options creates a soft link to a file.

使用不帶任何其他選項的命令會創建到文件的軟鏈接。

/D creates a symbolic link, or a soft link.

/ D創建符號鏈接或軟鏈接。

This essentially acts like a shortcut to a folder in prior versions of Windows, except you don’t have to use an actual shortcut.

在本質上,這與Windows早期版本中的文件夾快捷方式一樣,除非您不必使用實際的快捷方式。

/H creates a hard link, which points directly to the file.

/ H創建一個硬鏈接,該鏈接直接指向該文件。

This option can’t be used for folders directly for some reason, you’ll have to use the next option.

由于某些原因,該選項不能直接用于文件夾,您必須使用下一個選項。

/J creates a “Directory Junction”

/ J創建一個“目錄連接”

A Directory Junction?is actually just a hard link to a directory. This is a feature that existed prior to Vista as well.?If you are trying to symlink to a directory using a hard link, then you should use this option.

目錄連接實際上只是到目錄的硬鏈接。 這是Vista之前也存在的功能。 如果嘗試使用硬鏈接符號鏈接到目錄,則應使用此選項。

了解硬鏈接與軟鏈接 (Understanding Hard vs Soft Links)

Hard Link

硬鏈接

A hard link directly points to the file, and acts to the operating system as if it is the file itself. You’ll want to use this option the majority of the time if you are trying to fake an application’s directory.

硬鏈接直接指向文件,并像文件本身一樣作用于操作系統。 如果要偽造應用程序的目錄,則通常需要使用此選項。

Soft Link

軟鏈接

A soft link is essentially a shortcut to a file or folder – if you are using Windows explorer, you’ll be redirected to the directory if you double-click on a shortcut, it won’t pretend its part of the filesystem. You can still directly reference or open a file with the symlinked path, and it mostly works.

軟鏈接本質上是指向文件或文件夾的快捷方式-如果您使用的是Windows資源管理器,則雙擊快捷方式將重定向到該目錄,它不會偽裝成文件系統的一部分。 您仍然可以直接使用符號鏈接的路徑引用或打開文件,并且該文件大多數都可以使用。

使用網絡共享中的符號鏈接 (Using Symlinks from a Network Share)

One of the things that’s been extensively discussed is that you cannot use the Vista symlinks from another operating system (not surprising), but you cannot use them from a network share either. This is troublesome if you expect to use this feature on a web server or a file server.

被廣泛討論的一件事是,您不能使用來自另一個操作系統的Vista符號鏈接(不足為奇),但是您也不能從網絡共享中使用它們。 如果您希望在Web服務器或文件服務器上使用此功能,則很麻煩。

刪除符號鏈接 (Deleting Symlinks)

To delete a symlink, you can just delete the link. Just make sure you don’t delete the original file.

要刪除符號鏈接,您只需刪除鏈接。 只要確保您不刪除原始文件即可。

翻譯自: https://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278165.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278165.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278165.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

shell學習筆記--自我總結

一、文件 touch file # 創建空白文件 rm -rf 目錄名 # 不提示刪除非空目錄(-r:遞歸刪除 -f強制) dos2unix # windows文本轉linux文本 unix2dos # linux文本轉windows文本 enca filename # 查看編碼 安裝 yu…

201671030107胡文艷實驗三作業互評與改進報告

任務1&#xff1a;要給出所點評作業的鏈接地址&#xff0c;點評內容和閱讀心得 讀了你的這篇博客&#xff0c;一方面給我的印象就是排版整齊&#xff0c;內容充實&#xff0c;態度認真&#xff1b;另外一方面就是通過別人反省自己&#xff0c;看了你的博客&#xff0c;我覺得我…

進程handle獲取線程_獲取進程中的線程列表

進程handle獲取線程The System.Diagnostics namespace contains functions that allow you to manage processes, threads, eventlogs and performance information. System.Diagnostics命名空間包含允許您管理進程&#xff0c;線程&#xff0c;事件日志和性能信息的函數。 The…

2018-3-28Linux系統管理(16)計算機網絡基礎

在這一章當中我們講述計算機網絡基礎。一、計算機網絡網絡通信就像人與人之間的交流一樣&#xff0c;說同一種語言&#xff0c;而后雙方進行無障礙的通信交流&#xff0c;那么兩臺主機通信時&#xff0c;它們彼此交換數據的格式的前提為互相理解才可以&#xff0c;我們此前也有…

從Ubuntu命令行按進程名稱殺死進程

There are a number of ways to kill a process if you know the name of the process. Here’s a couple different ways you can accomplish this. We are going to assume that the process we are trying to kill is named irssi 如果您知道進程的名稱&#xff0c;則有多種…

18 南京 D

裸的最小球覆蓋。 坐標范圍大一些所以我們把初始的溫度也設置的大一些。 1 #include <bits/stdc.h>2 using namespace std;3 typedef long long ll;4 typedef double db;5 const db INF 1e100;6 const db delta 0.98;7 const db eps 1e-8;8 struct p3{9 db x,y,z;…

如何在iPhone或iPad的控制中心中控制智能家居設備

Apple’s Home app offers quick controls for controlling smart lights, doorbells, thermostats, and other smart home devices—right in your iPhone or iPad’s Control Center. Here’s how to set it up and use it. Apple的Home應用程序可在iPhone或iPad的控制中心內…

亞信安全與安徽電信共創“云網融合”安全新局面

全面提升公共安全能力 聯合推“天翼U盾”保障移動政務安全 在近日舉辦的安徽“互聯網”產業合作峰會上&#xff0c;亞信安全宣布與中國電信安徽公司達成戰略合作&#xff0c;雙方將在“云網融合”的生態基礎上打造特色安全服務、促進政企協同安全監管、共創網絡安全平安城市等…

idea中開啟Run Dashboard

若沒有 下一步 ok 轉載于:https://www.cnblogs.com/aijiajia1314/p/10551007.html

電臺復活節_如何玩Android 11的隱藏復活節彩蛋游戲

電臺復活節Justin Duino賈斯汀杜伊諾(Justin Duino)Google includes a hidden “Easter Egg” with each new Android version. Android 11 has one of the more elaborate Easter Eggs as it’s actually a game you can play. We’ll show you how to find it and play. Goog…

AQS源碼閱讀筆記(一)

AQS源碼閱讀筆記 先看下這個類張非常重要的一個靜態內部類Node。如下&#xff1a; static final class Node {//表示當前節點以共享模式等待鎖static final Node SHARED new Node();//表示當前模式以獨占模式等待鎖static final Node EXCLUSIVE null;//表示當前線程等待鎖的動…

python之實現從ftp下載文件到本地

#!/usr/bin/python # codingutf-8 import os from ftplib import FTP # 引入ftp模塊class MyFtp:ftp FTP()def __init__(self,host,port21):self.ftp.connect(host,port)def login(self,username,pwd):self.ftp.set_debuglevel(2) # 打開調試級別2&#xff0c;顯示詳細信息s…

如何在Instagram上過濾冒犯性評論

Shubham AgarwalShubham AgarwalIf you have a public Instagram profile, chances are you’ve been a victim of inappropriate comments from strangers. Given the social network’s vast size, it’s practically impossible to escape such bad actors. Thankfully, Ins…

復雜性思維中文第二版 附錄 A、算法分析

附錄 A、算法分析 原文&#xff1a;Appendix A Analysis of algorithms 譯者&#xff1a;飛龍 協議&#xff1a;CC BY-NC-SA 4.0 自豪地采用谷歌翻譯 部分參考了《Think Python 2e 中譯本 第二十一章&#xff1a;算法分析》 算法分析 (Analysis of algorithms) 是計算機科學的一…

如何在Windows 8.1中獲取Windows 10樣式的開始菜單

On January 21, Microsoft officially announced the new features that would be included in Windows 10. While you’ll have to wait for the release to enjoy most of the new features, you can take advantage of the new Windows 10 Start menu today. 1月21日&#x…

Android工程中javax annotation Nullable找不到的替代方案

我們在某些Android開源庫中會遇到下面的引用找不到的問題&#xff1a;import javax.annotation.Nonnull;import javax.annotation.Nullable; 其實Android實現了javax的類似注解&#xff0c;可以使用下面的引用替換&#xff1a;import android.support.annotation.NonNull;impor…

HDU1561:The more, The Better——題解

http://acm.hdu.edu.cn/showproblem.php?pid1561 ACboy很喜歡玩一種戰略游戲&#xff0c;在一個地圖上&#xff0c;有N座城堡&#xff0c;每座城堡都有一定的寶物&#xff0c;在每次游戲中ACboy允許攻克M個城堡并獲得里面的寶物。但由于地理位置原因&#xff0c;有些城堡不能直…

ubuntu列出所有磁盤_列出Ubuntu上的磁盤空間使用情況

ubuntu列出所有磁盤Simply open a new Terminal window and type in this command 只需打開一個新的終端窗口并輸入此命令 df -Th f翻譯自: https://www.howtogeek.com/howto/ubuntu/list-disk-space-usage-on-ubuntu/ubuntu列出所有磁盤

python基礎之字符編碼

閱讀目錄 一 了解字符編碼的知識儲備二 字符編碼介紹三 字符編碼應用之文件編輯器3.1 文本編輯器之nodpad3.2 文本編輯器之pycharm3.3 文本編輯器之python解釋器3.4 總結四 字符編碼應用之python4.1 執行python程序的三個階段4.2 python2與python3字符串類型的區別一 了解字符編…

C# WinForm開發系列 - DataGridView

1.DataGridView實現課程表 testcontrol.rar 2.DataGridView二維表頭及單元格合并 DataGridView單元格合并和二維表頭.rar myMultiColHeaderDgv.rar 3.DataGridView單元格顯示GIF圖片 gifanimationindatagrid.rar 4.自定義顯示DataGridView列(行頭顯示行號與圖標,同一單元格顯示…