看到cyz的留言,我才知道有Junction这个软件。
google了一下,发现了软件下载的地址:http://technet.microsoft.com/en-us/sysinternals/bb896768,微软官方的地址哦。。。在的版本是1.06,使用起来很方便。
下载到本地后,运行junction.exe,会出现一个安装窗口,然后就什么 都没有了。其实这时候是需要到命令行下运行。。
如果不会使用直接junction.exe -?,就可以了解一些参数和实际的方法了。
官方的例子是英文的,不翻译了,毕竟就两个参数,如果不想折腾,其实就用最简单方法,运行junction.exe -?的时候就有这个例子:junction.exe d:\link c:\windows
创建的时候,在d盘不能有link目录,否则会提示有错误,目录已存在,不能创建。。。。
- Windows 2000 and higher supports directory symbolic links, where a directory serves as a symbolic link to another directory on the computer. For example, if the directory D:\SYMLINK specified C:\WINNT\SYSTEM32 as its target, then an application accessing D:\SYMLINK\DRIVERS would in reality be accessing C:\WINNT\SYSTEM32\DRIVERS. Directory symbolic links are known as NTFS junctions in Windows. Unfortunately, Windows comes with no tools for creating junctions—you have to purchase the Win2K Resource Kit, which comes with the linkd program for creating junctions. I therefore decided to write my own junction-creating tool: Junction. Junction not only allows you to create NTFS junctions, it allows you to see if files or directories are actually reparse points. Reparse points are the mechanism on which NTFS junctions are based, and they are used by Windows' Remote Storage Service (RSS), as well as volume mount points.
- Please read this Microsoft KB article for tips on using junctions.
- Notethat Windows does not support junctions to directories on remote shares.
- If you want to view reparse information, the usage for Junction is the following:
- Using Junction
- Use junction to list junctions:
- Usage: [-s]
- -s Recurse subdirectories
- Examples:
- To determine if a file is a junction, specify the file name:
- junction c:\test
- To list junctions beneath a directory, include the –s switch:
- junction -s c:\
- To create a junction c:\Program-Files for "c:\Program Files":
- C:\>md Program-Files
- C:\>junction c:\Program-Files "c:\Program Files"
- To delete a junction, use the –d switch:
- junction -d c:\Program-Files
-------
然后再说cyz的那个T盘+junction。于是我在x盘里运行了junction.exe x:\xxx e:\www\htdocs\xxx,直接把我的xxx当成引用目录
看到这个上传的标记,我终于可以相当于指定目录了,而且存储在了快盘里。嗯,非常开心。指定目录的时候也很方便,不用象sugarsync那样,还得一个个的找目录(因为指定的非常乱)。
最后说一声,感谢cyz介绍的这个方法和软件【当然,它不是没有缺点,它的缺点就是。。。更改junction创建的目录里的文件时,快盘认不出它被修改了。也就是说它无法即时更新,非得我手动更新才行,而快盘又没有命令行,也不能设置多久自动更新一次。】