Does anybody know how to create a batch file that can shell one program if its a 64-bit system or shell another if its a 32-bit system?
相关问题
- How to get the return code of a shell script in lu
- Invoking Mirth Connect CLI with Powershell script
- xcopy include folder
- Batch file if string starts by
- Jenkins - cmd is not recognized
相关文章
- 使用2台跳板机的情况下如何使用scp传文件
- In IntelliJ IDEA, how can I create a key binding t
- shell中反引号 `` 赋值变量问题
- How get the time in milliseconds in FreeBSD?
- Why windows 64 still makes use of user32.dll etc?
- Launch interactive SSH bash session from PHP
- Generate disk usage graphs/charts with CLI only to
- Extracting columns from text file using Perl one-l
The below method should be pretty reliable since it will work even if environment variables have been messed with:
This method relies on the fact that "%WINDIR%\System32\kernel32.dll" should be present on all Windows systems. 64-bit versions of Windows also include "%WINDIR%\SysWOW64" directory containing 32-bit versions of system files, which is not present on 32-bit systems.
On 64-bit systems, 32-bit applications are redirected to SysWOW64 when trying to access files in System32. So, if we get same size kernel32.dll from both System32 and SysWOW64, it means that redirection is in effect and our script is running in 32-bit console on 64-bit OS.
It works without WMI too! I suggest: