Calm down. I see a vb6 example and ported to AutoIt.
#RequireAdmin
Func EnableDisableICS($sPublicConnectionName,$ssPrivateConnectionName,$bEnable)
Local $bFound =False
Dim $oNetSharingManager, $oConnectionCollection, $oItem, $EveryConnection, $objNCProps
$oNetSharingManager = ObjCreate("HNetCfg.HNetShare.1")
$oConnectionCollection = $oNetSharingManager.EnumEveryConnection
For $oItem In $oConnectionCollection
$EveryConnection = $oNetSharingManager.INetSharingConfigurationForINetConnection($oItem)
$objNCProps = $oNetSharingManager.NetConnectionProps($oItem)
If $objNCProps.name = $ssPrivateConnectionName Then
$bFound = True
;~ MsgBox(0,"","Starting Internet Sharing For: " & $objNCProps.name)
If $bEnable Then
$EveryConnection.EnableSharing(1)
Else
$EveryConnection.DisableSharing()
EndIf
EndIf
Next
$oConnectionCollection = $oNetSharingManager.EnumEveryConnection
For $oItem In $oConnectionCollection
$EveryConnection = $oNetSharingManager.INetSharingConfigurationForINetConnection($oItem)
$objNCProps = $oNetSharingManager.NetConnectionProps($oItem)
If $objNCProps.name = $sPublicConnectionName Then
$bFound = True
;~ MsgBox(0,"","Internet Sharing Success For: " & $objNCProps.name)
If $bEnable Then
$EveryConnection.EnableSharing(0)
Else
$EveryConnection.DisableSharing()
EndIf
EndIf
Next
Return $bFound
EndFunc
MsgBox(0,"",EnableDisableICS("YOUR ACTIVE NETWORK", "OUR ADAPTOR TO SHARE", True))
Saludos
.