Jump to content
Sign in to follow this  

Need help about Network sharing

Recommended Posts



I making a small tool that create wifi Hotspot use netsh cmd

All command is ok 

But only sharing option that i dont know how to control

That list all network for choice one network to share

Then set properties Sharing


I find any infomation about 2hour but i cant find anything

I thinking about control click but it will not right for all windows version

Please. Help me! Have you some ideas?

Share this post

Link to post
Share on other sites

Hi. Any one can help me please?

Share this post

Link to post
Share on other sites

I'd be willing to bet those settings are stored in the registry.  I'm not at a place where I can test this, but I'd recommend using procmon to see what registry keys are being set and try setting them via your autoit script.  It may take a disable/enable of the network interface for the changes to take effect.

Just my two cents

  • Like 1

Share this post

Link to post
Share on other sites

Calm down. I see a vb6 example and ported to AutoIt. 


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
    $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
    Return $bFound




  • Like 1

Share this post

Link to post
Share on other sites


Thx @Danyfirex

Your code work perfect!!!!!

Now i will trying to find how to list all network now my idea is ok

Thanks every body so much

You are the best :D

And. Happy new year, man! xD

Share this post

Link to post
Share on other sites

The code list all network here ($oConnectionCollection)  

You're wellcome. happy new year too.

if the topic is solved. mark as answered.


Edited by Danyfirex

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  

  • Similar Content

    • ur
      By ur
      An application is there which is created using vc++,mostly mfc.
      DOn't know the details completely.
      WHen I try to automate the control clicks for testing the UI.
      THe below control is not detected.
      As you can see, during UI operations I can click the elements one by one.
      But all the elements is selected as a whole set, when I use the Windowinfo tool.

      How to click this using AutoIT.?
      Please suggest.
    • Rskm
      By Rskm
      Hi, for a script of mine, I wish to keep a time frame on till how the program will work.. basically, I want the program to read the date and if the read date < 'a particular date', the program continues, else it exit. I don't want to read the time from the computer as the program can be fooled by resetting the pc time. is there a way to read time from internet - so that the user cannot fool the program by date reset? thanks
    • nacerbaaziz
      By nacerbaaziz

      Hi dear
      This is the first include file I designed
      This work is especially directed to NVDA free screen reader users
      It contains a set of functions that enable you to control the program
      Such as forcing the program to read a custom text
      Force it to stop talking
      Find out if the program is running
      And show custom text in the Braille screen
      Available functions are
      to load the dll file
      to UnLoad the dll file
      to speak a custom text
      to show custom text in the Braille screen
      to Force the NVDA  to stop talking
      to check if the NVDA is running
      important note :
      All of these functions depend on a nvdaControllerClient32.dll
      I've added it in the attachments, as well as a file for examples, and other files
      As the source and examples in other languages
      For those who wanted to download the free screen reader, this is the download link from the official website
      i hope you like this topic
      I hope you will try it and give me your opinions
      Thank you all members and administrators for their help
      now with the  Attachments
    • RHolmes
      By RHolmes
      I wrote a script a few months ago that was working at the time. When I tried it today it wouldn't retrieve any controls.  The application successfully launches, but I cannot figure out how to retrieve the control from the window that is launched. I'm on a windows 10 machine using AutoIt v3.3.14.2. The only thing I can think of that has changed is windows updates? Code is below, any help is greatly appreciated.    ; Notes: ; HandleError( handleToCheck, MsgToLogOnFailure, terminateAutoItOnFail ) : function that simply checks the handle and quits AutoIt if not present ; all of this works well FileChangeDir( $CLIENT_APPLICATION_DIR ); Run( "Client.exe" ) Local $hClient = WinWaitActive( $CLIENT_TITLE, "", 10 ) $terminateOnFail = 1 HandleError( $hClient, "LaunchClient::Error: Failed to launch client. Either timed-out or failed.", $terminateOnFail ) LogToFile( "Client launched, waiting for system to ready." ) Sleep( 5000 ) ; this part does not work ; $SYSTEM_INDICATOR is a global variable. I have tried these values: "SystemIndicatorWindow" (Text), "Qt5QWindowIcon101" (ClassNN), and ; "[CLASS:Qt5QWindowIcon; INSTANCE:101]" Local $hStatusIndicator = ControlGetHandle( $hClient, "", $SYSTEM_INDICATOR ) HandleError( $hStatusIndicator, "CheckStatus::Error: couldn't retrieve control: " & $SYSTEM_INDICATOR, $terminateOnFail ) This is what the spy reveals: 

      Edit: I just tried this code and it works for notepad++.
      FileChangeDir( "C:\Program Files\Notepad++\" ); Run( "notepad++.exe" ) Local $hNotePad = WinWaitActive( "new 1 - Notepad++", "", 10 ) If $hNotePad = 0 Or $hNotePad = -1 Then MsgBox( $MB_SYSTEMMODAL, "Error", "Error getting app handle." ) EndIf Sleep( 1000 ) Local $hNewFileBtn = ControlGetHandle( $hNotePad, "", "[CLASS:ToolbarWindow32; INSTANCE:1]" ) If $hNewFileBtn = 0 Or $hNewFileBtn = -1 Then MsgBox( $MB_SYSTEMMODAL, "Error", "Error getting button handle." ) EndIf MsgBox( $MB_SYSTEMMODAL, "Success", "Success." )  
    • rcmaehl
      By rcmaehl
      A UDF with Extended Functions for Window Management
      Fixes WinGetClassList's barbaric returning of a @LF separated string instead of an array.
      Potential Uses:
      Automating applications that change their controls' handles/classes on each launch (e.g. half of Cisco's programs)
      WindowEx.zip  (v0.4)
      10/04/2016 (v0.4): _WinGetClassNNList Fixed : Not Returning an Index when using $2D_ARRAY _WinGetClassNNList Fixed : Not Properly returning $aArray[x][1] on Classes with instances > 9 when using $2D_ARRAY 10/03/2016 (v0.3): _WinGetClassList Added : Exactly the same as WinGetClassList but returns a more civilized Array _WinGetClassNNList Added : Returns Classes and their instances in either a 1D or 2D array depending on Flags _WindowGetHandleList Renamed: _WinGetHandleList SCRIPT BREAKING! _WindowGetHandleListFromPos Renamed: _WinGetHandleListFromPos SCRIPT BREAKING! 10/01/2016 (v0.2): WindowsExConstants.au3 Added : Flags in _WindowGetHandleListFromPos _WindowGetHandleListFromPos Removed: ConsoleWrite left in during debug _WindowGetHandleListFromPos Added : Flag for if part of a Control is at $X, $Y return it as well. 10/01/2016 (v0.1): _WindowGetHandleList Added : Retrieves the handles of classes from a window. _WindowGetHandleListFromPos Added : Retrieves the handles of classes at a specific position from a window. Known and Reported Bugs:
      None reported To Do:
      To Be Decided. Opinions welcome! Upcoming Changes:
      To Be Decided.