Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is equivalent of mklink in Windows Powershell?

When I shift-right-click on a folder I had been able to "open command window here".

NOTE: I am NOT INTERESTED in the registry hack to put this feature back on.

After which I could use mklink to create symbolic links.

Under recent profound wisdom of Microsoft, after last couple of Windows 10 updates, "command window here" has been replaced with "powershell here".

Hence complying with Microsoft's esteemed wisdom implying that I should use powershell instead of the long outdated cmd

  • what is the equivalent of making a softlink in powershell?
  • and any other type of link that mklink could make?
like image 666
Blessed Geek Avatar asked May 23 '18 00:05

Blessed Geek


2 Answers

This is answered in [1]: https://stackoverflow.com/a/34905638/4744055

But use New-Item Powershell command. No DOS CMD necessary any more.

   New-Item -Path <to> -ItemType SymbolicLink -Value <from>
like image 100
Manabu Tokunaga Avatar answered Sep 22 '22 11:09

Manabu Tokunaga


You can create soft links in PowerShell via:

cmd /c mklink /J "<link>" "<target>"

The above uses old cmd in PowerShell. However, the above does not work for symbolic links (/D).

like image 27
Lidia Avatar answered Sep 19 '22 11:09

Lidia