Creating hard and soft links using PowerShell

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Creating hard and soft links using PowerShell

Message par Clippy »

Creating hard and soft links using PowerShell
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: Creating hard and soft links using PowerShell

Message par Clippy »

You can call the `mklink` provided by `cmd`, from PowerShell to make symbolic links:

```
cmd /c mklink c:\path\to\symlink c:\target\file

```

You must pass `/d` to `mklink` if the target is a directory.

```
cmd /c mklink /d c:\path\to\symlink c:\target\directory

```

For hard links, I suggest something like [Sysinternals Junction](http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx).
Répondre

Revenir à « PowerShell »