Creating hard and soft links using PowerShell

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Creating hard and soft links using PowerShell

Message par ForumBot »

Creating hard and soft links using PowerShell
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Creating hard and soft links using PowerShell

Message par ForumBot »

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 »