Alpinestar Posted April 28, 2009 Share Posted April 28, 2009 (edited) Hello I'm real sorry for such a stupid question. Basically I would like to find out the OS and if its a server or vista then exit the script. Below is the long version, ideally what I need help with is a simpler solution i.e IF @OSVersion = ('WIN_2008') Or ('WIN_VISTA') or ('WIN_2003') Then $q=0 EndIf $Opp = @OSVersion $q = 1 MsgBox(0,"iNFO","Os = " & $Opp) IF @OSVersion = ('WIN_2008') Then $q=0 ElseIf @OSVersion = ('WIN_VISTA') then $q=0 elseif @OSVersion = ('WIN_2003') Then $q=0 EndIf if $q=0 Then MsgBox(0,"OS", "Incorrect OS " & @OSVersion) Exit EndIf Edited April 28, 2009 by Alpinestar Link to comment Share on other sites More sharing options...
Yashied Posted April 28, 2009 Share Posted April 28, 2009 (edited) Hello I'm real sorry for such a stupid question. Basically I would like to find out the OS and if its a server or vista then exit the script. Below is the long version, ideally what I need help with is a simpler solution i.e IF @OSVersion = ('WIN_2008') Or ('WIN_VISTA') or ('WIN_2003') Then $q=0 EndIf $Opp = @OSVersion $q = 1 MsgBox(0,"iNFO","Os = " & $Opp) IF @OSVersion = ('WIN_2008') Then $q=0 ElseIf @OSVersion = ('WIN_VISTA') then $q=0 elseif @OSVersion = ('WIN_2003') Then $q=0 EndIf if $q=0 Then MsgBox(0,"OS", "Incorrect OS " & @OSVersion) Exit EndIfThe real answer to your question. $Opp = @OSVersion MsgBox(0,"iNFO","Os = " & $Opp) switch $Opp case 'WIN_2003', 'WIN_VISTA', 'WIN_2008' MsgBox(0,"OS", "Incorrect OS " & $Opp) Exit endswitch ... Edited April 28, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
LurchMan Posted April 28, 2009 Share Posted April 28, 2009 $Opp = @OSVersion MsgBox(0,"iNFO","Os = " & $Opp);Not sure why you have this? If @OSVersion = ('WIN_2008') Or ('WIN_VISTA') Or ('WIN_2003') Then MsgBox(0,"OS", "Incorrect OS " & @OSVersion) Exit EndIf Heres a shorter version...hope it helps Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Alpinestar Posted April 28, 2009 Author Share Posted April 28, 2009 Thanks guys for the rapid replys. Think I need a break as my brain hurts Link to comment Share on other sites More sharing options...
Yashied Posted April 28, 2009 Share Posted April 28, 2009 (edited) $Opp = @OSVersion MsgBox(0,"iNFO","Os = " & $Opp);Not sure why you have this? If @OSVersion = ('WIN_2008') Or ('WIN_VISTA') Or ('WIN_2003') Then MsgBox(0,"OS", "Incorrect OS " & @OSVersion) Exit EndIf Heres a shorter version...hope it helpsAfter 58 posts you wrote this? This is wrong. Edited April 28, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
LurchMan Posted April 28, 2009 Share Posted April 28, 2009 yeah...i tend to stick to the simple for the simple...and i left the parantheses on because i wans't quite awake yet so i just copy n pasted... my bad for being lazy in the morning.... Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
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