I have learnt that 32-bit code can not run natively through the X64 version of Windows. In order to run 32-bit applications, Windows makes use of the WOW64 emulator, which makes the 32-bit app’s think they are running on a 32-bit version of Windows. There were some more learning’s that I gathered around
If you look in the \Windows folder on any 32-bit system, you’ll see two subdirectories: one named SYSTEM and one named SYSTEM32. 16-bit DLL files (and other support files) are placed in the \Windows\System folder; 32-bit DLLs and various support files are placed in the \Windows\System32 folder. Effectively in 64-bit system, there should be a folder named \Windows\System64 and used it for 64-bit DLL files
Microsoft created a new folder named SysWOW64 for storing the 32-bit DLLs. But 32-bit applications are designed to place their DLL files in the \Windows\System32 folder. The \Windows\System32 folder still exists in the x64 version of Windows. But Microsoft uses this folder as a repository for 64-bit DLLs, not 32-bit DLLs. VERY CONFUSING!
Then where should 32-bit applications store their DLL files? is it \Windows\System32 folder?
When you install a 32-bit application, that installation wizard is running within the WOW64 emulator.WOW64 knows that the Setup wizard is a 32-bit application running within an emulator. Hence the WOW64 emulator aliases an alias to the \Windows\SysWOW64 folder. This means that any time a 32-bit application needs to read or write anything to or from the \Windows\System32 folder, the WOW64 emulator transparently redirects the request to the \Windows\SysWOW64 folder. so there is not much problem if you install using the installer.
But if you manually add some scripts to the \Windows\System32 folder and try to run a application ran the application, it was transparently being redirected to the \Windows\SysWOW64 folder and could not locate the scripts placed in System 32 folder