Jump to content
Sign in to follow this  
Tripredacus

Oops! I can't use an OR?

Recommended Posts

Tripredacus

Howdy doody!

I just figured AutoIT could use the OR operand, but this function doesn't run! Or am I just doing it wrong? Oh also, I didn't search because I could just imagine how many results I would get looking up "or"... :)

IF @OSVersion = "WIN_VISTA" OR "WIN_2008" Then 
    $StartupPath = "c:\users\administrator\appdata\roaming\microsoft\windows\startm~1\programs\startup\"
ElseIf @OSVersion = "WIN_XP" Then 
    $StartupPath = "c:\docume~1\alluse~1\startm~1\programs\startup\"
Else 
    $StartupPath = "error"
EndIf

Oh, uh it works just fine if I take out the "OR WIN_2008" before the then.

Share this post


Link to post
Share on other sites
jvanegmond

Yes, you're doing it wrong. Programming 101.

IF @OSVersion = "WIN_VISTA" OR "WIN_2008" Then

instead:

IF @OSVersion = "WIN_VISTA" OR @OSVersion = "WIN_2008" Then

And also: @StartMenuCommonDir

Edited by Manadar

Share this post


Link to post
Share on other sites
Tripredacus

OK that makes sense also. I don't use that other macro because the program needs to use the absolute path.

Share this post


Link to post
Share on other sites
jvanegmond

@StartMenuCommonDir is absolute path.

ConsoleWrite(@StartMenuCommonDir & @CRLF)

Output: C:\ProgramData\Microsoft\Windows\Start Menu

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  

×