Zerobug

Enable to copy a file in @SystemDir

6 posts in this topic

Hi Guys,

I have a little problem, maybe you can help me.

I trying to copy a file (DLL) in "C:\Windows\System32", but unfortunnately, the file is never copied.

I have tried with these commands : 

FileInstall("C:\Data\Autoit\mdivwctl.dll", @SystemDir & "\mdivwctl.dll", 1)

or 

FileCopy ("C:\Data\Autoit\mdivwctl.dll","C:\Windows\System32",1)

On both, it doesn't works. But if I copy on "c:\Windows" it works.

Maybe a permission issue ? I'm administrator of the computer, and if I drag and drop the file on sys32 folder, it works fine...

Any idea ?

 

Share this post


Link to post
Share on other sites



In the UAC is enable, put #RequireAdmin at the top of your script

If you are using a 64 bits OS, the file is probably copied in the C:\Windows\SysWOW64 folder

If you want to copy the file in the System32 folder with a 64 bits OS, you should disable the WOW64 redirection before running the copy (_WinAPI_Wow64EnableWow64FsRedirection ( 0)) An other way is to copy the file in c:\windows\sysnative folder

1 person likes this

Share this post


Link to post
Share on other sites

Thanks for the tips ! It works.

You're right, the file was in  C:\Windows\SysWOW64

I have change my script by this : 

Quote

 

#RequireAdmin

#include <WinAPIFiles.au3>

_WinAPI_Wow64EnableWow64FsRedirection (0)
FileInstall("C:\Data\Autoit\mdivwctl.dll", @SystemDir & "\mdivwctl.dll", 1)

 

Share this post


Link to post
Share on other sites

My bad, it does'nt works. File is still in  C:\Windows\SysWOW64

 

FileInstall("C:\Data\Autoit\mdivwctl.dll","C:\Windows\System32\",1)

It works like that.

But i don't know why _WinAPI_Wow64EnableWow64FsRedirection (0) does'nt works.

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