Create NTFS junction point in Python

Rafał Dowgird picture Rafał Dowgird · Jul 17, 2009 · Viewed 9.9k times · Source

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.

Answer

CharlesB picture CharlesB · Feb 1, 2016

Since Python 3.5 there's a function CreateJunction in _winapi module.

import _winapi
_winapi.CreateJunction(source, target)