Share internet via wifi using command line [closed]

2

I have a wifi adapter, or it could be a notebook, and I share the internet via Wifi, that's not the problem, here's how I create a wifi network:

  

Create a wifi network

     
  • Access the CMD as an administrator;
  •   
  • netsh wlan set hostednetwork mode=allow ssid=nomeHost key=senha
  •   
  • netsh wlan start hostednetwork
  •   

    With these steps I leave the wifi network to connect, and to give access   the internet over the network, access to the control panel > network and internet >   Network connection.

         

    After that, in the cable network properties, the default,   usually "Ethernet", on the sharing tab, select the first and   option, and in the Home Connection select the local connection that   was created by the command, usually "Local Connection *", something like this.

    Problem:
    I would like to execute the steps of sharing via the command line, because sometimes during the day I need to reboot, because it simply stops working.

    If someone at least knows what I can use, some windows component. I do not want programs that do this for me, I want to do it myself.

        
    asked by anonymous 29.08.2017 / 20:22

    1 answer

    1

    Before you know what a shell script is, it's important to know the which is a shell.

    You will have to create a file of type * .bat and add these commands to the file:

    netsh wlan set hostednetwork mode=allow ssid=nomeHost key=senha
    netsh wlan start hostednetwork
    

    In Windows boot, this will depend on the version of windows you are using, How to run automatically a BAT file when you turn on the computer

    All the things you want to do to connect share and see network you can add the commands in this * .bat file How to create a batch file .

        
    29.08.2017 / 20:36