Jump to content
Sign in to follow this  

Using FileCreateNTFSLink to link directories

Recommended Posts



Does anybody know how I can create a hardlink from an directory to an other?

I know that the destination directory must be empty.

But creating the link always fails.

I tried to link a file, and that works...

Simple test script:

DirCreate("C:\system directory")
MsgBox(0, "", FileCreateNTFSLink("C:\windows\system32", "C:\system directory"))



Share this post

Link to post
Share on other sites

Try this code without creating the folder/directory.

If Not FileExists('C:\system directory\') Then
    MsgBox(0, "", FileCreateNTFSLink("C:\windows\system32\", "C:\system directory\"))

You now know that the directory should not exist before creating the junction point now.


Share this post

Link to post
Share on other sites

It works :)

I know the directory must be empty.. But it wasn't good enough


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.