Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Can't write to System32 under Win7 x64

$
0
0
I simply need to copy a file that disables Adobe Flash auto-update to both - System32 and SYSWOW64 system folders.

[ autoit ]      
FileCopy (@ScriptDir & '\Data\mms.cfg', @WindowsDir & '\SysWow64\Macromed\Flash') FileCopy (@ScriptDir & '\Data\mms.cfg', @WindowsDir & '\System32\Macromed\Flash')

File doesn't get copied to System32 folder, only to SYSWOW64 (and yes, all directories exist). UAC is off. Any ideas? If I need some special permissions, how do I obtain them via script?


Edit: Doesn't look like a permission issue. Created a copy of "Flash" folder, took ownership of it, and still can't copy there. I'm lost.

Also tried

[ autoit ]      
DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

and it doesn't help, either.


Wait, it actually works now. Last time I disabled redirection, I used a wrong system directory variable. Stupid me. :/

Working code:

[ autoit ]      
;Flash Update Disabler DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) FileCopy (@ScriptDir & '\Data\mms.cfg', @WindowsDir & '\System32\Macromed\Flash\mms.cfg', 1) ;Writes to SystemDir on x86, writes to 64-bit SystemDir on x64 FileCopy (@ScriptDir & '\Data\mms.cfg', @WindowsDir & '\SysWow64\Macromed\Flash\mms.cfg', 1) ;Does nothing on x86, writes to 32-bit SystemDir on x64 DllCall("kernel32.dll", "int", "Wow64EnableWow64FsRedirection", "int", 1)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>