Jump to content

Real Simple help needed


Recommended Posts

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 by Alpinestar
Link to comment
Share on other sites

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
The 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 by Yashied
Link to comment
Share on other sites

$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

$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

After 58 posts you wrote this? This is wrong.

^_^

Edited by Yashied
Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...