Jump to content
Sign in to follow this  

[Solved] File system permission differt between FileCopy & FileMove

Recommended Posts


I've a problem when using FileMove function with resulting file permission.

I've discover the problem because there is a lock overlayed icon the moved file:

Posted Image

Here an example script to reproduce my problem:

$file=@TempDir & "\filetest.txt"
FileWriteLine($filehndl, "some text")
FileCopy($file, @SystemDir & "\filetest_copy.txt",1)
FileMove($file, @SystemDir & "\filetest_move.txt",1)
Run('Explorer.exe "' & @SystemDir & '"')

The @SystemDir & "\filetest_copy.txt" has it permissions inherit from the @systemdir folder (which is normal)

but the @SystemDir & "\filetest_move.txt" has it own permissions (and this is problematic)

Posted Image Posted Image

So my questions are simple:

  • Is this normal or a bug?
  • If it's a bug how can I solve it?

PS: I'm using Win7x64 OS

Edited by taz742

Share this post

Link to post
Share on other sites


this is a standard MS behaviour:

Copy file -> get security from folder

Move file on same partition -> keep security from file

Move file to other partition -> get security from folder

So you might copy file and then delete source.



Share this post

Link to post
Share on other sites

Thanks for your reply.

I've discovered what you explain doing a copy and move operation with DOS routine.

So it's definitely NOT an AutoIt lack or bug.

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.