我是 VBScript 文件的初学者如果我尝试验证操作系统的版本是 Microsoft Windows XP Professional 还是 Microsoft Windows 7 Professional 我需要帮助如何修复以下代码:
set service = GetObject ("winmgmts:")
Dim os_7, os_xp
os_7="Microsoft Windows 7 Professional"
os_xp="Microsoft Windows XP Professional"
for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "notes2.exe" then
WScript.Echo "Please Close the Lotus Notes Application and try again"
WScript.quit
End If
exit for
next
Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
for each System in SystemSet
WScript.Echo System.Caption
If System.Caption = os_7 Then
WScript.Echo "in 7"
Else If System.Caption = os_xp Then
WScript.Echo "in XP"
WScript.quit
Else
WScript.Echo "Is not supported "
End If
End If
Exit for
next
}
非常感谢您的帮助