How to follow a symbolic/soft link in cmd or PowerShell?

前端 未结 2 1765
悲&欢浪女
悲&欢浪女 2021-01-13 16:04

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 PowerS

2条回答
  •  情话喂你
    2021-01-13 16:57

    For your question i made this batch file:

    mkdir truedir
    dir > truedir\fileone.txt
    mklink /d symdir truedir
    cd symdir
    dir
    

    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\\OneDrive\Desktop\test2\symdir
    

    Can you give us a code example (batch or powershell is the same) to replicate your problem?

提交回复
热议问题