Sign in to follow this  
Followers 0
ahmeddzcom

iF win7 iF win8

4 posts in this topic

Hi guys

i need:

   if windows 7 then

        MsgBox(0,"note ","  windows 7 ")

   if windows 8 then

        MsgBox(0,"note ","  windows 8 ")

and XP and Vista

Thx.

Share this post


Link to post
Share on other sites



open help file in autoit script

read macros

1 person likes this

Share this post


Link to post
Share on other sites

open help file in autoit script

read macros

 

THX

....................

If @OSVersion = "WIN_81" Then
MsgBox(0,"","WIN_8.1")

ElseIf @OSVersion = "WIN_8" Then
MsgBox(0,"","WIN_8")

ElseIf @OSVersion = "WIN_7" Then
MsgBox(0,"","WIN_7")

ElseIf @OSVersion = "WIN_VISTA" Then
MsgBox(0,"","Vista")

ElseIf @OSVersion = "WIN_XP" Then
MsgBox(0,"","XP")
EndIf

Share this post


Link to post
Share on other sites

Or use a switch statement:

Switch @OSVersion
 Case "WIN_8.1"
  ;do something for WIN 8.1
 Case "WIN_8"
  ;do something for WIN 8
 Case "WIN_7"
  ;do something for WIN 7
 Case "WIN_Vista"
  ;do something for Vista
 Case "WIN_XP"
  ;do something for XP
EndSwitch

 

The benefit to doing it this way is if you want to have one function that covers multiple circumstances. For example, if you want your script to do one thing if the OS is below Windows 8, you could do something like this:

Switch @OSVersion
 Case "WIN_8.1"
  ;do something for WIN 8.1
 Case "WIN_8"
  ;do something for WIN 8
 Case "WIN_7", "WIN_Vista", "WIN_XP"
  ;do something for OS prior to Windows 8
EndSwitch
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0