Belini Posted March 21, 2018 Posted March 21, 2018 I need to connect in wifi network whenever my program opens and to do this I need to put user and password, how can I do this using Autoit? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
Earthshine Posted March 21, 2018 Posted March 21, 2018 What have you tried My resources are limited. You must ask the right questions
Belini Posted March 21, 2018 Author Posted March 21, 2018 (edited) I'm searching here https://www.autoitscript.com/forum/topic/91018-native-wifi-functions/ but I still have not found what I need! Edited March 21, 2018 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
Moderators JLogan3o13 Posted March 21, 2018 Moderators Posted March 21, 2018 @Belini you have been around long enough to know you need to show some effort. A google search like this: Quote site:autoitscript.com wifi yields over 400 results, many of which have examples with code in them. You cannot tell us you have looked at them all. Earthshine 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Belini Posted March 22, 2018 Author Posted March 22, 2018 (edited) I've read every topic related to NativeWifi.au3 but I was unable to connect with user and password and I was able to just list the available wifi networks, does anyone have a hint on how to connect? expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <wifi33a.au3> Global $Cb_rede, $Inp_pass, $But_refresh, $But_connect _Wlan_StartSession() Gui() Func Gui() GUICreate("Wifi connection", 434, 104, -1, -1) GUICtrlCreateLabel("Rede wifi:", 8, 20, 51, 17) GUICtrlCreateLabel("Password:", 253, 20, 53, 17) $Cb_rede = GUICtrlCreateCombo("Choose a network", 64, 16, 169, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) update_combo() $Inp_pass = GUICtrlCreateInput("", 312, 16, 113, 21, BitOR($ES_PASSWORD, $ES_CENTER, $ES_NUMBER)) $But_refresh = GUICtrlCreateButton("Refresh", 40, 64, 139, 25) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $But_connect = GUICtrlCreateButton("Connect", 246, 64, 139, 25) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetState($But_connect, $GUI_FOCUS) GUISetState(@SW_SHOW) EndFunc ;==>Gui While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $But_refresh update_combo() Case $But_connect $rede = GUICtrlRead($Cb_rede) $pass = GUICtrlRead($Inp_pass) ; I do not know how to connect to the network EndSwitch WEnd Func update_combo() Local $data = "", $scan = "" GUICtrlSetData($Cb_rede, "") $scan = _Wlan_GetAvailableNetworkList(0) $avaiable = UBound($scan) - 1 If $avaiable > 0 Then For $i = 0 To $avaiable $data &= $scan[$i][0] & "|" Next GUICtrlSetData($Cb_rede, $data, $scan[0][0]) EndIf EndFunc ;==>update_combo Edited March 22, 2018 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
ViciousXUSMC Posted March 22, 2018 Posted March 22, 2018 Netsh should do the trick https://www.techworm.net/2016/10/connect-manage-delete-wi-fi-networks-using-command-prompt.html https://www.hanselman.com/blog/HowToConnectToAWirelessWIFINetworkFromTheCommandLineInWindows7.aspx
Belini Posted March 22, 2018 Author Posted March 22, 2018 The second link did not help and the first link did not open! My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
Bilgus Posted March 22, 2018 Posted March 22, 2018 Quote the first link did not open! Did for me did you make sure your wifi was connected first?
Bilgus Posted March 22, 2018 Posted March 22, 2018 And the second link does have the info you need albeit some is in the comments section basically what it says is that you need an xml file containing the credentials
Belini Posted March 22, 2018 Author Posted March 22, 2018 What I need is to choose a network, enter the password and connect!List the wifi networks I can already but I can not connect using the password I have! My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
Moderators JLogan3o13 Posted March 22, 2018 Moderators Posted March 22, 2018 (edited) Did you try the commands contained in the second link outside of AutoIt, so you know whether it is the actual netsh command that is failing or something in the AutoIt implementation of it? Just saying "I can not connect using the password I have!" tells us exactly nothing as to what exactly you're seeing. Edited March 22, 2018 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Belini Posted March 22, 2018 Author Posted March 22, 2018 (edited) I can connect only on wifi networks that already have the saved password and I want to connect in other networks I want to choose the network and enter the password of it, do I have to create some profile for new network? I guess I'm not sure how to use the _Wlan_Connect () function to send network name and password! Edited March 22, 2018 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
Moderators JLogan3o13 Posted March 22, 2018 Moderators Posted March 22, 2018 Again - why are you unwilling to read that second link, wanting someone to spoon feed it all back to you??? You have to use netsh wlan add --- In order to add a new profile, you need an XML file - which the link spells out for you in the comments section. The only additional help anyone can give you is to write the whole thing for you. Earthshine 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Belini Posted March 22, 2018 Author Posted March 22, 2018 (edited) Sorry for my ignorance because I thought it would suffice to send the network name and password to connect and I did not know that I would need an .xml file just to send this data, I will search on how I would create this file since it will not work without this ! I have been researching this about yesterday and I could not make it work but I do not want anyone to do it for me, just tell me what steps I need to take to send the network name and password to connect? Edited March 22, 2018 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
kosamja Posted March 22, 2018 Posted March 22, 2018 In this topic: there is link for this tool: https://support.arubanetworks.com/ToolsResources/tabid/76/EntryId/109/DMXModule/514/Default.aspx , maybe you can use it to first create wifi profile and then to connect
Belini Posted March 23, 2018 Author Posted March 23, 2018 (edited) @kosamja thanks for the link's, I'll choose to try to create the .xml file EDIT: Does anyone know where the .xml profile is saved? Edited March 23, 2018 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
Moderators JLogan3o13 Posted March 23, 2018 Moderators Posted March 23, 2018 A 2 second Google search would show you the answer: c:\programdata\Microsoft\Wlansvc\Profiles\Interfaces\ "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Belini Posted March 23, 2018 Author Posted March 23, 2018 I have compared the .xml I have here and my question is how to get the data of <hex>************</ hex> and <key material>************* </ key material> The other data I know to get and I can make the exchange! My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ
MattyD Posted March 1, 2020 Posted March 1, 2020 On 3/23/2018 at 5:32 AM, Belini said: I've read every topic related to NativeWifi.au3 but I was unable to connect with user and password and I was able to just list the available wifi networks, does anyone have a hint on how to connect? Hey, I know this is an old thread, but for the benefit of others reading this.. As touched on, you need to generate a profile to connect to. If you are planning on using that old UDF, there are examples in the zip file on sourceforge on how to do this (providing it still works on modern windows builds!). Matt
Earthshine Posted March 2, 2020 Posted March 2, 2020 (edited) Please don’t necropost. I’m sure he’s not still looking for the answer two years later Edited March 2, 2020 by Earthshine My resources are limited. You must ask the right questions
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now