windows - 如何使用 VBScript 确定我运行的是 32 位还是 64 位 Windows 操作系统?

标签 windows vbscript 32bit-64bit

如何在 VBScript 中检测 Windows 操作系统的位数(32 位与 64 位)?

我尝试过这种方法,但它不起作用;我猜 (x86) 导致了一些检查文件夹的问题..

还有其他选择吗?

progFiles="c:\program files" & "(" & "x86" & ")"

set fileSys=CreateObject("Scripting.FileSystemObject")

If fileSys.FolderExists(progFiles) Then    
   WScript.Echo "Folder Exists"    
End If

最佳答案

前几天在工作中遇到了同样的问题。偶然发现了这个天才的 vbscript 片段,觉得它太好了,不能不分享。

Bits = GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth

来源:http://csi-windows.com/toolkit/csi-getosbits

关于windows - 如何使用 VBScript 确定我运行的是 32 位还是 64 位 Windows 操作系统?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3583604/

相关文章:

windows - pthreads-win32 在各种 Windows 编译器上的可移植性

c - 无法在 C (windows) 中使用 fopen 从共享驱动器访问文件

python - 具有重要目录结构的 pyinstaller

windows - 基于Windows的GKE中的ContainerD节点

.net - 另一个 "could not load file or assembly ... or one of its dependencies. The system cannot find the file specified"

c++ - 64位系统下的size_t(-1)和int(-1)

http - (HP QuickTest) 如何使用 QuickTest 获取 HTTP 状态?

javascript - 如何为 asp.button 设置替代文本

json - 如何使用 VBScript 通过 HTTP API POST JSON 数据?

c# - 将应用程序从 32 位移动到 64 位