IntControl 92

Syntax:

IntControl(92, operation, value, 0, 0) (64-bit Windows only)

 

IntControl 92 has no effect when a script is run by native 64-bit WinBatch or as a compiled native 64-bit executable.

 

WinBatch 32-bit Only

Disables or reverts file system redirection when running in WOW64 (32-bit emulation under 64-bit Windows).

When 32-bit WinBatch is run a 64 bit Windows platform the Windows file system auto-magically redirects file operations that refer to 64 bit directories to the 32 bit equivalents. For example, the %windir%\System32 directory is reserved for 64-bit applications. Since most System DLL file names were not changed when porting to 64-bit, 32-bit applications must use a different directory as their System32 directory. WOW64 hides this difference using file system redirection. Whenever a 32-bit application,like WinBatch, attempts to access %windir%\System32, the access is redirected to a new directory, %windir%\SysWOW64. IntControl 92 can be used to disable this functionality.

 

"operation" may be either "Disable" or "Revert".

 

If "operation" is "Disable", file system redirection is disabled, and the function returns a value that should be specified on a subsequent "Revert" operation. "Value" should be set to 0.

 

If "operation" is "Revert", file system redirection is reverted to the state specified by "value", which should be the result of a previous "Disable" operation. Returns a non-zero value on success.

 

NOTE: It is important to minimize the code run when the File System Redirection is disabled, especially when loading WIL Extenders, using COM, or doing anything that asks Windows to load any new DLLs. The problem is that while File System Redirection is disabled, your code will be looking at the wrong version of windows and will attempt to load wrong (64 instead of 32 bit) versions of modules, and usually fail, GPF, or otherwise not function properly.

 

Returns a value as specified above, or -1 on error.

 

Example:
oldvalue = IntControl( 92, "disable", 0, 0, 0 )
ret = FileExist( "C:\Windows\System32\cmd.exe" )
IntControl( 92, "revert", oldvalue, 0, 0 )