Jump to content
Sign in to follow this  

Adding 2 Variables Together

Recommended Posts


Quick question hopefully

Say I have the following


$SP_VERSION = @OSServicePack

How could I get $TOTAL to equal them together with a SPACE inbetween

So that it would be $TOTAL = Win_XP Service Pack 1

I need something like $TOTAL = ($OS_VERSION( + ($SP_VERSION)

But I do not know how to write it...please help

Share this post

Link to post
Share on other sites

You can use all 3 variables, but you don't need to. Instead, you can do something like this:

$FullOS = (@OSVersion & " " & @OSServicePack)
MsgBox(0, "OS", $FullOS)

Share this post

Link to post
Share on other sites

egridley has ir correct.

To add numbers use +

To concatenate strings and variables use &

To do a Logic question use AND



"Foo" & "Bar"="FooBar"

if 1=1 AND 2=2 Then ; This is true

con·cat·e·nate    ( P )  Pronunciation Key  (kn-ktn-t, kn-)

tr.v. con·cat·e·nat·ed, con·cat·e·nat·ing, con·cat·e·nates

1. To connect or link in a series or chain.

2. Computer Science. To arrange (strings of characters) into a chained list.

AutoIt3, the MACGYVER Pocket Knife for computers.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.