A junction (also called a soft link) is a symbolic link of a special type of file that contains a reference to another file or directory. Junctions can link directories located on different local volumes on the same computer. Otherwise, junctions operate identically to hard links. Junctions are implemented through reparse points.
Questions tagged [junction]
120 questions
40
votes
8 answers
powershell to resolve junction target path
In PowerShell, I need resolve the target path of a junction (symlink).
for example, say I have a junction c:\someJunction whose target is c:\temp\target
I tried variations of $junc = Get-Item c:\someJunction, but was only able to get…

ash
- 3,354
- 5
- 26
- 33
29
votes
3 answers
Powershell Remove Symbolic Link Windows
I am having issues when removing SymbolicLinks which I have created with New-Item:
New-Item -ItemType SymbolicLink -Path C:\SPI -Target "C:\Users\Chino\Dropbox (Reserve Membership)\"
I need to modify the link because it has the wrong -Target, which…

thebusiness11
- 501
- 2
- 9
- 24
22
votes
5 answers
Create NTFS junction point in Python
Is there a way to create an NTFS junction point in Python? I know I can call the junction utility, but it would be better not to rely on external tools.

Rafał Dowgird
- 43,216
- 11
- 77
- 90
18
votes
1 answer
NTFS Junctions vs. Symbolic Links (for directories)
From a high-level standpoint (meaning only worrying about the results and the interface, not the implementation), what is the difference in behavior, if any, between an NTFS reparse point that points to a directory and a symbolic link that points to…

user541686
- 205,094
- 128
- 528
- 886
16
votes
2 answers
Detecting if a directory is a junction in Delphi
I've been Google searching this I may be having some brain clouds because it just isn't working.
I need to detect if a folder is a junction so my recursive file search doesn't run off into an endless loop.
I could use a simple function like…

Daniel
- 315
- 5
- 16
14
votes
5 answers
PowerShell Remove Junction
As of Windows 10 PowerShell is finally capable of creating Junctions and links natively.
Howerver the Remove-Item function seems to be unaware of the junction and tries to remove the directory asking for confirmation and if it should recursively…

Mastacheata
- 1,866
- 2
- 21
- 32
14
votes
2 answers
How to create a Junction Point using WinApi?
There is CreateHardLink function to create Hardlinks.(Since Win2000)
And there is CreateSymbolicLink function since Vista has been released.
But why isn't there a CreateJunction?
How does mklink make a junction?
And How do I write codes to make…

Benjamin
- 10,085
- 19
- 80
- 130
12
votes
2 answers
C# detect folder junctions in a path
I want to make a quick check if in a complete path a Junction point is used. I already have a function to test a folder like IsJunction() but maybe there is an other solution to not call IsJunction() on every subfolder.
So I'm looking for a function…

fpdragon
- 1,867
- 4
- 25
- 36
10
votes
3 answers
How to return the values in a junction as an array?
Define a junction my $j = 1 | 2 | 3 | 4 | 5, now I want to get an array of its value [1 2 3 4 5], how should I implement this?
I tried $j.values but Perl6 gave me the whole junction as an element: [any((1), (2), (3), (4), (5))].

hwding
- 840
- 10
- 22
9
votes
1 answer
How to use junction inside a perl6 regex interpolation?
Sometimes I have a long list and I would like to check whether a string matches anything in the list. I am trying to interpolate a junction inside a regex. They are all errors.
say "12345" ~~ m/ <{ (2,3,4).any }> /
Cannot resolve caller…

lisprogtor
- 5,677
- 11
- 17
8
votes
7 answers
Test in PowerShell code if a folder is a junction point?
How can I test in PowerShell code if a folder is a junction point?

Serge van den Oever
- 4,340
- 8
- 45
- 66
8
votes
2 answers
How to copy junction as-is instead of the folder it points to?
I copy set of folders from server 1 to server 2. Amongst files I also have junction: folder with set of config files: on server 1 this junction points to... let's say c:\Config (that contains config1.cfg, config2.cfg)
On server 2 I also have…

Alexander
- 1,152
- 1
- 16
- 18
7
votes
2 answers
Matching a Junction makes Match immutable
Just for the heck of it, I am trying to match a junction against a regex with the m// operator in raku (search for Explicit topic match on that page).
In the perl6 REPL:
> any('a','b') ~~ m/./
False
Afterwards, no matter how I call m// I get an…

grobber
- 1,083
- 1
- 9
- 20
7
votes
2 answers
Having trouble implementing a readlink() function
I've been trying to figure out a way to get some sort of ability to be able to return the true abspath of a symbolic link in Windows, under Python 2.7. (I cannot upgrade to 3.x, as most DCCs such as Maya/3ds max do not use that version of…

sonictk
- 178
- 2
- 10
7
votes
3 answers
How can I remove a Windows directory without following junction points?
I have a Perl script that needs to delete a directory with all its contents.
Sometimes this directory contains a junction point into another directory. If I rmtree() naively, the rmtree() call will also delete all the files inside the target folder…

Lucas Meijer
- 4,424
- 6
- 36
- 53