本帖最后由 vszy 于 2016-3-25 06:56 编辑 $OS=@OSVersion
$BIT=@OSArch
Select
case $BIT="X86" and ($OS="WIN_XP" or $OS="WIN_2003")
MsgBox("","","XPXPXP")
Case $BIT="X86" and ($OS="WIN_7" or $OS="WIN_2003")
MsgBox("","","786786")
Case $BIT="X64" and ($OS="WIN_7" or $OS="WIN_2003")
MsgBox("","","764764")
Case $BIT="X86" and ($OS="WIN_81" or $OS="WIN_8")
MsgBox("","","832832")
Case $BIT="X64" and ($OS="WIN_81" or $OS="WIN_8")
MsgBox("","","864864")
Case Else
MsgBox("","","未识别")
EndSelect
这个代码编译后可以全系统正确运行。
换了个写法:$OS=@OSVersion
$BIT=@OSArch
Select
case $BIT="X86" and ($OS="WIN_XP" or $OS="WIN_2003")
$txt = XPXPXP
MsgBox("","",$txt)
Case $BIT="X86" and ($OS="WIN_7" or $OS="WIN_VISTA")
$txt = 786786
MsgBox("","",$txt)
Case $BIT="X64" and ($OS="WIN_7" or $OS="WIN_VISTA")
$txt = 764764
MsgBox("","",$txt)
Case $BIT="X86" and ($OS="WIN_81" or $OS="WIN_8")
$txt = 832832
MsgBox("","",$txt)
Case $BIT="X64" and ($OS="WIN_81" or $OS="WIN_8")
$txt = 864864
MsgBox("","",$txt)
Case Else
MsgBox("",""," 未能识别")
EndSelect
编译后只有XP系统报错,其它正常,不知为何?望有XP环境的测试下。
|