How do you create a new symlink in windows 10 using powershell (not mklink.exe)?











up vote
4
down vote

favorite
1












If there's docs on it, I'll take that. Any web searches for "symlink" "symbolic link" "windows [10]" "powershell" returns everything except the base command.



Even the powershell docs site returns nothing. Is this not possible?










share|improve this question






















  • Why don’t you want to use mklink you can call it from a PowerShell prompt and/or script
    – Ramhound
    Mar 24 at 0:51












  • Please see docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic
    – Epoxy
    Mar 24 at 1:07












  • @Epoxy Thank you. Fun Fact: using the search box on the top level of that site returns "No results" when searching for sym. In other words, you can't find it if you don't know where it is.
    – monsto
    Mar 24 at 1:15












  • You are quite welcome! :)
    – Epoxy
    Mar 24 at 1:19















up vote
4
down vote

favorite
1












If there's docs on it, I'll take that. Any web searches for "symlink" "symbolic link" "windows [10]" "powershell" returns everything except the base command.



Even the powershell docs site returns nothing. Is this not possible?










share|improve this question






















  • Why don’t you want to use mklink you can call it from a PowerShell prompt and/or script
    – Ramhound
    Mar 24 at 0:51












  • Please see docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic
    – Epoxy
    Mar 24 at 1:07












  • @Epoxy Thank you. Fun Fact: using the search box on the top level of that site returns "No results" when searching for sym. In other words, you can't find it if you don't know where it is.
    – monsto
    Mar 24 at 1:15












  • You are quite welcome! :)
    – Epoxy
    Mar 24 at 1:19













up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





If there's docs on it, I'll take that. Any web searches for "symlink" "symbolic link" "windows [10]" "powershell" returns everything except the base command.



Even the powershell docs site returns nothing. Is this not possible?










share|improve this question













If there's docs on it, I'll take that. Any web searches for "symlink" "symbolic link" "windows [10]" "powershell" returns everything except the base command.



Even the powershell docs site returns nothing. Is this not possible?







windows-10 powershell






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 0:46









monsto

2301311




2301311












  • Why don’t you want to use mklink you can call it from a PowerShell prompt and/or script
    – Ramhound
    Mar 24 at 0:51












  • Please see docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic
    – Epoxy
    Mar 24 at 1:07












  • @Epoxy Thank you. Fun Fact: using the search box on the top level of that site returns "No results" when searching for sym. In other words, you can't find it if you don't know where it is.
    – monsto
    Mar 24 at 1:15












  • You are quite welcome! :)
    – Epoxy
    Mar 24 at 1:19


















  • Why don’t you want to use mklink you can call it from a PowerShell prompt and/or script
    – Ramhound
    Mar 24 at 0:51












  • Please see docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic
    – Epoxy
    Mar 24 at 1:07












  • @Epoxy Thank you. Fun Fact: using the search box on the top level of that site returns "No results" when searching for sym. In other words, you can't find it if you don't know where it is.
    – monsto
    Mar 24 at 1:15












  • You are quite welcome! :)
    – Epoxy
    Mar 24 at 1:19
















Why don’t you want to use mklink you can call it from a PowerShell prompt and/or script
– Ramhound
Mar 24 at 0:51






Why don’t you want to use mklink you can call it from a PowerShell prompt and/or script
– Ramhound
Mar 24 at 0:51














Please see docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic
– Epoxy
Mar 24 at 1:07






Please see docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic
– Epoxy
Mar 24 at 1:07














@Epoxy Thank you. Fun Fact: using the search box on the top level of that site returns "No results" when searching for sym. In other words, you can't find it if you don't know where it is.
– monsto
Mar 24 at 1:15






@Epoxy Thank you. Fun Fact: using the search box on the top level of that site returns "No results" when searching for sym. In other words, you can't find it if you don't know where it is.
– monsto
Mar 24 at 1:15














You are quite welcome! :)
– Epoxy
Mar 24 at 1:19




You are quite welcome! :)
– Epoxy
Mar 24 at 1:19










2 Answers
2






active

oldest

votes

















up vote
4
down vote



accepted











  1. Start powershell as admin

  2. You need to know 1) the path to target of the link 2) path to location where you want the link 3) the name you want to use to refer to the link.

  3. PS C:> new-item -itemtype symboliclink -path <path to location> -name <the name> -value <path to target>


Example: If you're in c:driversAMD and you want to link in f:driverolddrivers, then you would go



PS C:> new-item -itemtype symboliclink -path . -name OldDrivers -value f:driverolddrivers



And wind up with a symlink path of c:driverAMDOldDrivers






share|improve this answer





















  • That's because mklink is a specific tool for a specific purpose. Powershell New-Item is a very general tool. It can do much more than create directories and symlinks.
    – monsto
    Mar 24 at 3:07










  • perfect! for those who are wondering, this also works for creating symbolic links to directories ... PS C:Usersmcoog> New-Item -itemtype symboliclink -path . -name .vim -value C:UsersmcoogDropbox.vim
    – ricardo
    Aug 11 at 5:05






  • 1




    FYI, ItemType SymbolicLink was added in PowerShell 5.0
    – Brettski
    Nov 9 at 5:29


















up vote
0
down vote













+-----------------------+-----------------------------------------------------------+
| mklink syntax | Powershell equivalent |
+-----------------------+-----------------------------------------------------------+
| mklink Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
| mklink /D Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
| mklink /H Link Target | New-Item -ItemType HardLink -Name Link -Target Target |
| mklink /J Link Target | New-Item -ItemType Junction -Name Link -Target Target |
+-----------------------+-----------------------------------------------------------+


mklink reference: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

Powershell symlink reference: https://docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1307360%2fhow-do-you-create-a-new-symlink-in-windows-10-using-powershell-not-mklink-exe%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted











    1. Start powershell as admin

    2. You need to know 1) the path to target of the link 2) path to location where you want the link 3) the name you want to use to refer to the link.

    3. PS C:> new-item -itemtype symboliclink -path <path to location> -name <the name> -value <path to target>


    Example: If you're in c:driversAMD and you want to link in f:driverolddrivers, then you would go



    PS C:> new-item -itemtype symboliclink -path . -name OldDrivers -value f:driverolddrivers



    And wind up with a symlink path of c:driverAMDOldDrivers






    share|improve this answer





















    • That's because mklink is a specific tool for a specific purpose. Powershell New-Item is a very general tool. It can do much more than create directories and symlinks.
      – monsto
      Mar 24 at 3:07










    • perfect! for those who are wondering, this also works for creating symbolic links to directories ... PS C:Usersmcoog> New-Item -itemtype symboliclink -path . -name .vim -value C:UsersmcoogDropbox.vim
      – ricardo
      Aug 11 at 5:05






    • 1




      FYI, ItemType SymbolicLink was added in PowerShell 5.0
      – Brettski
      Nov 9 at 5:29















    up vote
    4
    down vote



    accepted











    1. Start powershell as admin

    2. You need to know 1) the path to target of the link 2) path to location where you want the link 3) the name you want to use to refer to the link.

    3. PS C:> new-item -itemtype symboliclink -path <path to location> -name <the name> -value <path to target>


    Example: If you're in c:driversAMD and you want to link in f:driverolddrivers, then you would go



    PS C:> new-item -itemtype symboliclink -path . -name OldDrivers -value f:driverolddrivers



    And wind up with a symlink path of c:driverAMDOldDrivers






    share|improve this answer





















    • That's because mklink is a specific tool for a specific purpose. Powershell New-Item is a very general tool. It can do much more than create directories and symlinks.
      – monsto
      Mar 24 at 3:07










    • perfect! for those who are wondering, this also works for creating symbolic links to directories ... PS C:Usersmcoog> New-Item -itemtype symboliclink -path . -name .vim -value C:UsersmcoogDropbox.vim
      – ricardo
      Aug 11 at 5:05






    • 1




      FYI, ItemType SymbolicLink was added in PowerShell 5.0
      – Brettski
      Nov 9 at 5:29













    up vote
    4
    down vote



    accepted







    up vote
    4
    down vote



    accepted







    1. Start powershell as admin

    2. You need to know 1) the path to target of the link 2) path to location where you want the link 3) the name you want to use to refer to the link.

    3. PS C:> new-item -itemtype symboliclink -path <path to location> -name <the name> -value <path to target>


    Example: If you're in c:driversAMD and you want to link in f:driverolddrivers, then you would go



    PS C:> new-item -itemtype symboliclink -path . -name OldDrivers -value f:driverolddrivers



    And wind up with a symlink path of c:driverAMDOldDrivers






    share|improve this answer













    1. Start powershell as admin

    2. You need to know 1) the path to target of the link 2) path to location where you want the link 3) the name you want to use to refer to the link.

    3. PS C:> new-item -itemtype symboliclink -path <path to location> -name <the name> -value <path to target>


    Example: If you're in c:driversAMD and you want to link in f:driverolddrivers, then you would go



    PS C:> new-item -itemtype symboliclink -path . -name OldDrivers -value f:driverolddrivers



    And wind up with a symlink path of c:driverAMDOldDrivers







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 24 at 1:07









    monsto

    2301311




    2301311












    • That's because mklink is a specific tool for a specific purpose. Powershell New-Item is a very general tool. It can do much more than create directories and symlinks.
      – monsto
      Mar 24 at 3:07










    • perfect! for those who are wondering, this also works for creating symbolic links to directories ... PS C:Usersmcoog> New-Item -itemtype symboliclink -path . -name .vim -value C:UsersmcoogDropbox.vim
      – ricardo
      Aug 11 at 5:05






    • 1




      FYI, ItemType SymbolicLink was added in PowerShell 5.0
      – Brettski
      Nov 9 at 5:29


















    • That's because mklink is a specific tool for a specific purpose. Powershell New-Item is a very general tool. It can do much more than create directories and symlinks.
      – monsto
      Mar 24 at 3:07










    • perfect! for those who are wondering, this also works for creating symbolic links to directories ... PS C:Usersmcoog> New-Item -itemtype symboliclink -path . -name .vim -value C:UsersmcoogDropbox.vim
      – ricardo
      Aug 11 at 5:05






    • 1




      FYI, ItemType SymbolicLink was added in PowerShell 5.0
      – Brettski
      Nov 9 at 5:29
















    That's because mklink is a specific tool for a specific purpose. Powershell New-Item is a very general tool. It can do much more than create directories and symlinks.
    – monsto
    Mar 24 at 3:07




    That's because mklink is a specific tool for a specific purpose. Powershell New-Item is a very general tool. It can do much more than create directories and symlinks.
    – monsto
    Mar 24 at 3:07












    perfect! for those who are wondering, this also works for creating symbolic links to directories ... PS C:Usersmcoog> New-Item -itemtype symboliclink -path . -name .vim -value C:UsersmcoogDropbox.vim
    – ricardo
    Aug 11 at 5:05




    perfect! for those who are wondering, this also works for creating symbolic links to directories ... PS C:Usersmcoog> New-Item -itemtype symboliclink -path . -name .vim -value C:UsersmcoogDropbox.vim
    – ricardo
    Aug 11 at 5:05




    1




    1




    FYI, ItemType SymbolicLink was added in PowerShell 5.0
    – Brettski
    Nov 9 at 5:29




    FYI, ItemType SymbolicLink was added in PowerShell 5.0
    – Brettski
    Nov 9 at 5:29












    up vote
    0
    down vote













    +-----------------------+-----------------------------------------------------------+
    | mklink syntax | Powershell equivalent |
    +-----------------------+-----------------------------------------------------------+
    | mklink Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
    | mklink /D Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
    | mklink /H Link Target | New-Item -ItemType HardLink -Name Link -Target Target |
    | mklink /J Link Target | New-Item -ItemType Junction -Name Link -Target Target |
    +-----------------------+-----------------------------------------------------------+


    mklink reference: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

    Powershell symlink reference: https://docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic






    share|improve this answer



























      up vote
      0
      down vote













      +-----------------------+-----------------------------------------------------------+
      | mklink syntax | Powershell equivalent |
      +-----------------------+-----------------------------------------------------------+
      | mklink Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
      | mklink /D Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
      | mklink /H Link Target | New-Item -ItemType HardLink -Name Link -Target Target |
      | mklink /J Link Target | New-Item -ItemType Junction -Name Link -Target Target |
      +-----------------------+-----------------------------------------------------------+


      mklink reference: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

      Powershell symlink reference: https://docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        +-----------------------+-----------------------------------------------------------+
        | mklink syntax | Powershell equivalent |
        +-----------------------+-----------------------------------------------------------+
        | mklink Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
        | mklink /D Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
        | mklink /H Link Target | New-Item -ItemType HardLink -Name Link -Target Target |
        | mklink /J Link Target | New-Item -ItemType Junction -Name Link -Target Target |
        +-----------------------+-----------------------------------------------------------+


        mklink reference: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

        Powershell symlink reference: https://docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic






        share|improve this answer














        +-----------------------+-----------------------------------------------------------+
        | mklink syntax | Powershell equivalent |
        +-----------------------+-----------------------------------------------------------+
        | mklink Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
        | mklink /D Link Target | New-Item -ItemType SymbolicLink -Name Link -Target Target |
        | mklink /H Link Target | New-Item -ItemType HardLink -Name Link -Target Target |
        | mklink /J Link Target | New-Item -ItemType Junction -Name Link -Target Target |
        +-----------------------+-----------------------------------------------------------+


        mklink reference: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink

        Powershell symlink reference: https://docs.microsoft.com/en-us/powershell/wmf/5.0/feedback_symbolic







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 16 at 11:17

























        answered Nov 16 at 8:27









        Ian Kemp

        130111




        130111






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1307360%2fhow-do-you-create-a-new-symlink-in-windows-10-using-powershell-not-mklink-exe%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            QoS: MAC-Priority for clients behind a repeater

            Ивакино (Тотемский район)

            Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)