Sign in to follow this  
Followers 0
Ghastly_MIB

Using FileCreateNTFSLink to link directories

3 posts in this topic

Hey,

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:

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

Thanks,

Mathijs

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\"))
EndIf

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

Thanks!!

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  
Followers 0