Thanks a lot for replying bro...really appreciate it
Yes, I kinda understand more now after some reading...here's how my script look like at the end...I made it do what I wanted it to do...
1. Shows the windows with the text "please wait" while the whole script is running.
2. Script runs at STARTUP so insert 35seconds delay to wait windows to load up completely.
3. Runs function to remove a wireless network profile.
4. Popup login client that we use that needs to be closed down before continuing.
5. With the help of tool "devcon" from Microsoft, I'm able to disable/enable the WiFi Card and by then having the connection repaired and connected to the other profile automatically.
It is kinda crappy code... but if you see, I used your old Wifi v2.2 functions.
Kinda new to AutoIt but so far like it very much.
~Locobans
#include "Native_Wifi_Func_V2_2.au3"
SplashTextOn("IT Department", "Please wait while your wireless is being configured.", 250, 80, -1, -1, 4, "", 14)
sleep(35000)
_DeleteWifi()
sleep(5000)
if WinExists("Cisco Clean Access Agent") then
WinClose("Cisco Clean Access Agent")
EndIf
RunWait(@ComSpec & " /c " & "devcon disable *DEV_4236*") ; Disable the WiFi card
sleep(10000)
RunWait(@ComSpec & " /c " & "devcon enable *DEV_4236*") ; Enables the WiFi Card
sleep(5000)
SplashOff()
MsgBox(0, "IT Department", "You can now login to the CSADMIN network")
;*********************************************************************************************
;************************************FUNCTIONS PART*******************************************
;*********************************************************************************************
Func _DeleteWifi()
$SSID = "STUDENT_WIFI" ; Enter wireless network name to be removed
$hClientHandle = _Wlan_OpenHandle()
$Enum = _Wlan_EnumInterfaces($hClientHandle)
$pGUID = $Enum[0][0]
$a_iCall = DllCall($WLANAPIDLL, "dword", "WlanDeleteProfile", "hwnd", $hClientHandle, "ptr", $pGUID, "wstr", $SSID, "ptr", 0)
EndFunc
#cs
**************************Function not used anymore**************************
Func _AddProfile()
$XMLProfile = FileRead("C:\Program Files\Scripts\Profile.xml") ; Name of the file containing the profile
$hClientHandle = _Wlan_OpenHandle()
$Enum = _Wlan_EnumInterfaces($hClientHandle)
$pGUID = $Enum[0][0]
$a_iCall = DllCall($WLANAPIDLL, "dword", "WlanSetProfile", "hwnd", $hClientHandle, "ptr", $pGUID, "dword", 0, "wstr", $XMLProfile, "ptr", 0, "int", 1, "ptr", 0, "dword*", 0)
ConsoleWrite("Call Error: " & @error & @LF)
ConsoleWrite(_Wlan_GetErrorMessage($a_iCall[0]))
EndFunc
#ce
Edit: It the code, you have an AddProfile function commented that I was using to SET A PROFILE already saved in a XML file with all proper configuration...read it couple of posts back in the post
Offtopic: can someone change my name to Locobans... I misspelled...