Jump to content
Sign in to follow this  

cmdline ubound array

Recommended Posts


Hi there,

i'm fairly new to autoit and started with a simple portscanner with some code i found in the autoit forums. The thing i cannot get my head around is, how do i use $aports from the command line. I tried everything i could think of. I think it has something to do with constants and ubound.

The code below works like it is, but i would like to be able to parse the ports to scan from the command line. Simply replacing [80,85,587,25] with $cmdline[2] does not work.

My goal is to use it from the commandline with ipaddress as $cmdline[1] and a portrange (example) 80,443,139 as $cmdline[2]

Any help would be much appreciated

local $aports = [80,85,587,25]

For $i = 0 To UBound($aPorts) - 1
    $iSocket = TCPConnect($cmdline[1], $aPorts[$i])
    If @error Then
        ConsoleWrite("not connected" & @CRLF)
        ConsoleWrite("connected" & @CRLF)

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.