ahmeddzcom Posted November 28, 2014 Posted November 28, 2014 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.
boy15 Posted November 28, 2014 Posted November 28, 2014 open help file in autoit script read macros ahmeddzcom 1
ahmeddzcom Posted November 28, 2014 Author Posted November 28, 2014 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
Moderators JLogan3o13 Posted November 29, 2014 Moderators Posted November 29, 2014 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 ahmeddzcom 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now