Code: Select all
f := FileOpen("C:\Windows\System32\dwm.exe","r","CP0")
if !IsObject(f)
MsgBox 0
MsgBox % FileExist("C:\Windows\System32\dwm.exe")
Are there any reasons for this behavior?
Code: Select all
f := FileOpen("C:\Windows\System32\dwm.exe","r","CP0")
if !IsObject(f)
MsgBox 0
MsgBox % FileExist("C:\Windows\System32\dwm.exe")
Source: https://autohotkey.com/boards/viewtopic ... 679#p20679lexikos wrote:If you're running 32-bit AutoHotkey (or any 32-bit program) on a 64-bit OS, C:\Windows\System32 is redirected to C:\Windows\SysWow64. In that case, [file] most likely really doesn't exist at that path, as accessed from a 32-bit program.
For AutoHotkey 32-bit, use SysNative instead of System32.
Code: Select all
f := FileOpen("C:\Windows\SysNative\dwm.exe","r","CP0")
if !IsObject(f)
MsgBox 0
MsgBox % FileExist("C:\Windows\SysNative\dwm.exe")
Code: Select all
MsgBox % FileExist("C:\Windows\" (A_PtrSize = 8 ? "System32" : "SysNative") "\dwm.exe")
Users browsing this forum: Google [Bot] and 53 guests