I am new to autoit, this is my first programming language. As a starter i want to create a script with an inputbox asking the user what the preferred SSID of a network that your trying to connect to; declairing the input as a variable to be used in a cmd script. But cant figure out how to call the variable within the cmd script. So far i have compiled this with no success. I also checked the help file with examples inclding the return values, which have me confused. This is what i have so far.
How should i go about the first "if" statement?I want the string of what the user put into the inputbox to run inside my cmd "netsh wlan connect" script.Also if i were to exicute the script without '$answer' inside my cmd script. The program's windows will be in the top left hand side of the screen. I wanted to get it centered. But Any help is appriciated!
[ autoit ]
$answer = InputBox ( "Start Program", "This process will restart your Wireless Network Connection and start Program. Please Enter the SSID of the Wireless Network", "Type SSID Here", "", _ - 1, -1, 0, 0 ) If $answer == 1 Then Run ('C:\WINDOWS\System32\cmd.exe' & " /c " & 'netsh wlan disconnect interface="Wireless Network Connection"', "", @SW_HIDE) Sleep ( 2000 ) Run ('C:\Program Files (x86)\program.exe') Sleep ( 10000 ) Run ('C:\WINDOWS\System32\cmd.exe' & " /c " & 'netsh wlan connect name='$answer' ssid='$answer' interface="Wireless Network Connection"', "", @SW_HIDE) ElseIf $answer == 2 Then ProcessClose("program.exe")EndIf
How should i go about the first "if" statement?I want the string of what the user put into the inputbox to run inside my cmd "netsh wlan connect" script.Also if i were to exicute the script without '$answer' inside my cmd script. The program's windows will be in the top left hand side of the screen. I wanted to get it centered. But Any help is appriciated!