junction.exe 多程序共用一个目录数据或转移目录地址的命令junction.exe junction 教程

 

junction 下载地址:
http://download.sysinternals.com/Files/Junction.zip
适用于使用 NTFS 的 NT 系列系统

进入CMD,接着运行 junction D:\LINK D:\WINDOWS ,命令的意思是创建一个名为 D:\LINK 的 junction 目录,指向   D:\WINDOWS ,该命令瞬间执行完成。接着在执行 dir 命令查看目录结构,发现多了一个名字为 LINK ,类型为 JUNCTION 的目录。

  我们去资源管理器查看一下,可以看到 D:\LINK 和 D:\WINDOWS 文件夹内容一模一样,如果你对其中任意一个文件夹里面的内容做修改,另一个也会相应的改变,呵呵,我们也建立出了这种“神奇”的目录。而且磁盘空间使用量没有改变哦,因为只是实现连接罢了,并不是将原文件复制以及同步。

1. 将Windows\Installer复制到一个空闲空间大一点的分区,例如D:\***X\Installer;
2. 删除C:\Windows\Installer;
3. 用管理员身份进入CMD窗口,进入Windows目录(CD WINDOWS),键入:[path]\junction Installer D:\***X\Installer
4. 完成。

重复以上的4个步骤,可以把一些平常基本不用或不变的目录(例如winsxs、C:\Windows\System32\DriverStore\FileRepository等等)转移到其他分区存放,这样的好处就是,系统功能没有任何精简,并且不影响任何使用,C盘负担已经大大减轻。

Junction v1.05 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2007 Mark Russinovich
Systems Internals - http://www.sysinternals.com

The first usage is for displaying reparse point information, and the
second usage is for creating or deleting a NTFS junction point:

usage: junction.exe [-s] [-q] <file or directory>
       -q     Don't print error messages (quiet)

       -s     Recurse subdirectories

usage: junction.exe [-d] <junction directory> [<junction target>]
       -d     Delete the specified junction
       example: junction d:\link c:\winnt


 

本文出自 “运维系统管理” 博客,谢绝转载!

你可能感兴趣的:(命令,exe,目录,教程,junction)