# Disable redirection mechanism in Windows XP x64

## Recommended Posts

I use a script compiled in 32 bit OS which copy some files to Program Files dir.

In XP x64 the files are copied to C:\Program Files (x86) instead of C:\Program Files. I used

`DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)`

to disable the redirection mechanism, but didn't work. The question is: can I use a

script compiled in 32 bit mode which work in 64 bit environment?

Edited by ffdshow

##### Share on other sites

32 bit applications can be run in a 64 bit environment, but you cannot load dlls of the wrong type.

##### Share on other sites

32 bit applications can be run in a 64 bit environment, but you cannot load dlls of the wrong type.

I know they are working in 64 bit environment, but how can I copy those files to C:\Program Files by-passing the redirection mechanism? The files are copied to C:\Program Files (x86) instead of C:\Program Files. Thanks.

##### Share on other sites

I'm afraid I'm not sure of how to do that. You know you can compile 64 bit AutoIt scripts though.

##### Share on other sites

Your code is not correct. It should be

```\$OldValue = DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "ptr*", 0)
If Not @error Then \$OldValue = \$OldValue[1]```
Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

##### Share on other sites

Your code is not correct. It should be

```\$OldValue = DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "ptr*", 0)
If Not @error Then \$OldValue = \$OldValue[1]```
Still not working.

##### Share on other sites

What do you mean by "not working"?

##### Share on other sites

What do you mean by "not working"?

I mean that the redirection mechanism is not disable with ProgAndy's code and my files still goes

to %programfiles(x86)% instead of %programfiles% using the script compiled in x86 flavor.

## Create an account

Register a new account