Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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. 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. 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:

I

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

  • No labels