1

私は VBScript ファイルの初心者です。Microsoft Windows XP Professional または Microsoft Windows 7 Professional の場合、OS のバージョンを検証しようとすると、次のコードを修正するにはどうすればよいですか?

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
}

あなたの助けに感謝します

4

5 に答える 5