如何在cmd或PowerShell中遵循符号/软链接? [英] How to follow a symbolic/soft link in cmd or PowerShell?
问题描述
我的搜索仅向我展示了如何使用cmd中的 mklink 创建符号链接.我已经看到一些事情说要使用 readlink ,但是PowerShell和cmd不知道什么是 readlink ,并且 cd 显然不起作用.那我该怎么做呢?
My searches have only shown me how to create symbolic links using mklink in cmd. I have seen some things saying to use readlink, but PowerShell and cmd don't know what readlink is, and cd obviously doesn't work. So how do I follow one?
推荐答案
对于您的问题,我制作了此批处理文件:
For your question i made this batch file:
mkdir truedir
dir > truedir\fileone.txt
mklink /d symdir truedir
cd symdir
dir
我发现从命令提示符处获取到目录的符号链接的内容没有问题. Powershell 5.1(Win 10)也没问题:
And i have found no problem to get the content of the symblic link to a directory from command prompt. No problem also with powershell 5.1 (win 10):
Get-ChildItem C:\Users\<user>\OneDrive\Desktop\test2\symdir
您能给我们一个代码示例(批处理或powershell相同)来复制您的问题吗?
Can you give us a code example (batch or powershell is the same) to replicate your problem?
这篇关于如何在cmd或PowerShell中遵循符号/软链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!