File System Redirector

In many cases when writing a batch script for Landesk packages, we may need to use tools located in the system32 folder (csscript.exe for example). When calling these tools, we need to provide the right path for them in the script.

The %windir%\System32 directory is reserved for 64-bit applications ONLY after Windows Vista x64. Most DLL file names were not changed when 64-bit versions of the DLLs were created, so 32-bit versions of the DLLs are stored in a different directory. WOW64 hides this difference by using a file system redirector.

32-bit applications can access the native system directory by using %windir%\Sysnative. For 32-bit processes on 64-bit systems, %windir%\system32 folder can only be accessed by specifying %windir%\sysnative folder. sysnative is an alias, so it can't be access directly. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access. This mechanism is flexible and easy to use, therefore, it is the recommended mechanism to bypass file system redirection. Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one.

Example:

IF EXIST %windir%\syswow64 (
%windir%\sysnative\cscript.exe PATH_TO_SCRIPT\test.vbs
)
ELSE
cscript.exe PATH_TO_SCRIPT\test.vbs

For more information refer to MS KB: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187%28v=vs.85%29.aspx

Information on the Tufts IT Knowledgebase is intended for IT Professionals at Tufts.
If you have a question about a Tufts IT service or computer/account support, please contact your IT support group.