How to share Wi-Fi from your computer using Notepad

Many people are familiar with the situation where they have internet access on a desktop computer or laptop with a wired connection, but can't share it with other devices. Often, a router is not available, or it's temporarily broken, and the phone's mobile data has run out. In such cases, the operating system Windows Offers built-in tools that let you turn your PC into a fully-fledged access point without installing third-party software.

Using the standard Notepad In conjunction with the command line, this isn't just a life hack, but a reliable method that works even when the system's graphical interface fails. By creating a special .bat file, you will be able to start and stop it Wi-Fi network with one click, which is much more convenient than entering commands manually through the console each time.

This method requires minimal preparation but gives you full control over your network settings, including your username and password. The main advantage is that you don't need to download dubious downloads, which often contain ads or viruses. Below, we'll explain in detail how to create such a file, what commands to write, and how to avoid common errors when running it.

📊 What is your main source of wired internet at home?
Ethernet cable from the provider
USB modem
Another PC via LAN
I only have Wi-Fi

Hardware and software requirements

Before you begin setting up, you need to make sure your hardware meets the minimum requirements. The key element here is network adapter, which must support the "Monitoring" or "Hosted Network" operating mode. Most modern Wi-Fi modules released after 2010 support this feature by default.

The operating system must be at least Windows 7, since it was in this version that native support for Microsoft virtual adapters appeared. Windows 10 And Windows 11 The mechanism remains the same, although Microsoft is gradually introducing new methods of distribution through the settings menu, but the command line remains the most universal tool.

  • 📡 A working Wi-Fi adapter (built-in or USB).
  • 💻 Operating system Windows 7, 8, 10 or 11.
  • 🔌 Active wired internet connection (Ethernet).
  • 🔑 Administrator rights to run commands.

It's important to note that if you're using a laptop that's already connected to the internet via Wi-Fi, distributing the same signal to other devices via the built-in adapter is technically impossible without additional equipment. This requires the incoming signal to be transmitted via a cable and outgoing wirelessly, or using two different Wi-Fi adapters.

⚠️ Important: Your wireless adapter's drivers must be installed correctly. If the device is marked with a yellow exclamation mark in Device Manager, first install the official drivers from the manufacturer's website.

Checking virtual network mode support

The first step before creating a file for distribution is to diagnose your hardware. Not all network cards can operate in access point emulation mode, so you need to confirm with the system. For this, we use a built-in utility. netsh, which manages Windows network settings.

Open a command prompt with administrator rights. You can do this by finding the application in the Start menu. cmdby right-clicking and selecting the appropriate option. In the window that opens, enter the verification command: netsh wlan show driversThis command will output a detailed report about your wireless adapter driver.

In the list of displayed information, find the line "Hosted network supported." If it says "Yes," your adapter is ready to use, and you can safely proceed to creating the script. If it says "No," you won't be able to share the internet using software—you'll need to replace the Wi-Fi module or update the drivers to a newer version from the official website.

Creating a distribution launch file using Notepad

Now we move on to the most important part – writing the code that will control your access point. We'll create a simple text file that Windows will treat as an executable program. Open the standard Notebook (Notepad) via search or the Start menu.

In a blank editor window, paste the commands that will perform three actions in sequence: enable virtual network mode, set a name and password, and start the distribution. Copy the code below and paste it into Notepad, replacing the data with your own.

netsh wlan set hostednetwork mode=allow ssid=MyNetwork key=MyPassword123

netsh wlan start hostednetwork

In this instruction ssid=MyNetwork sets the network name that other devices will see, and key=MyPassword123 Sets a password for the connection. The password must be at least 8 characters long. After entering the code, click "File" → "Save As." In the "Save as type" field, select "All files" and specify "Name" in the "Save as" field. start_wifi.bat. Extension .bat is critically important as it tells the system that this is a batch file of commands.

  • 💾 Save the file to your desktop for quick access.
  • 📝 Use only Latin letters in the network name and password.
  • 🔒 Avoid using special characters in your password to avoid syntax errors.

Once saved, a file icon will appear on your desktop. To start sharing, right-click on it and select "Run as administrator." If everything went well, a message will appear in the command prompt (which may flash for a split second or remain frozen) indicating that the network has been created and started.

☑️ Check before running the BAT file

Completed: 0 / 4

Setting up Internet sharing

Running the created file will create a virtual adapter, but the internet will not be transmitted through it yet. The computer has created an "empty" network that can be accessed, but connected devices will not have access to the external network (World Wide Web). Traffic forwarding must be configured.

To do this, open the Control Panel and go to Network and Internet → Network and Sharing Center. In the left menu, select Change adapter settings. Here you will see a list of all network connections. Find the adapter that your computer is using. receives Internet (usually this is "Ethernet" or "Local Area Connection").

Right-click on the active connection and select "Properties." Go to the "Sharing" tab. Check the box next to "Allow other network users to connect through this computer's Internet connection." In the "Home networking connection" drop-down list, select the name of your virtual network (usually called "Wireless Connection" or "Wireless Network" with a number, e.g., Wireless Network 2).

Parameter Value for setting Where to find
Network name (SSID) MyNetwork (your) In the BAT file after ssid=
Password Min 8 characters In the BAT file after key=
Access type Allow all The Access tab in Ethernet properties
Protocol IPv4 Adapter properties

After clicking "OK," the system may warn you about changing your IP address. Agree. Now, devices connected to your Wi-Fi will access the global network through your computer. The process takes a few seconds and usually doesn't require a reboot.

⚠️ Important: If you lose internet access on your computer after enabling network sharing, try temporarily disabling your antivirus or firewall. Sometimes they block port forwarding between adapters.

Managing the created access point

Once the network is up and running, you may need to manage it: turn it off when it's not needed, or check its status. Launch the previously created start_wifi.bat This isn't necessary every time if you just want to stop the network. To do this, create another companion file to stop the distribution.

Create a new text file and paste the command there. netsh wlan stop hostednetwork and save as stop_wifi.batRunning this file as an administrator will immediately disable the Wi-Fi module's tethering mode, but the settings will remain. This is convenient for not revealing the network's MAC address when you leave the house.

To view the list of connected devices and their IP addresses, use the command netsh wlan show hostednetworkIt will show the number of clients, network status, and detailed information about each connected device. This is useful for monitoring: you'll immediately see if anyone is hogging your channel.

How do I change my network password or name?

To change network settings, you don't need to create a new file. Simply right-click your start_wifi.bat file, select "Edit" (or "Open with Notepad"), change the values ​​after ssid= and key=, save the file, and run it again. The new settings will overwrite the old ones.

Solving common startup problems

Despite the simplicity of the method, users often encounter errors when starting it. One of the most common is "Failed to start the hosted network." This may occur because the WLAN AutoConfig service is disabled in the system. Check its status in the "Services" section (enter services.msc in the search) and make sure that it is working and is in the "Automatic" mode.

Another common issue is IP address conflicts. If your computer and the virtual adapter try to use the same addresses, the connection will fail. In this case, resetting the network settings with the command netsh int ip reset in the command line with administrator rights, followed by a PC reboot.

  • 🔄 Restart the WLAN AutoConfig service.
  • 🛡️ Check your Windows Firewall settings.
  • 🔌 Reconnect the Ethernet cable after setup.
  • 💻 Update your Wi-Fi adapter drivers.

It's also worth considering that some corporate security policies or specific provider settings may block internet tethering (TTL filters). This is rare at home, but if you have internet access on your connected phone but pages aren't loading, check your DNS settings and try manually entering them. 8.8.8.8 in the connection properties on the phone.

Frequently Asked Questions (FAQ)

Is it possible to share Wi-Fi if the computer is also connected to the Internet via Wi-Fi?

This can't be done using standard Windows tools, as a single physical adapter can't simultaneously receive and transmit a signal on the same frequency. This requires a second USB Wi-Fi adapter or special virtual drivers that emulate a second device, but their stability is not guaranteed.

Why does the phone see the network, but says "Failed to connect"?

Most often, the problem lies in the encryption type or password length. Make sure that the command key= You specified a password that is at least 8 characters long. Also, try changing the security type in the registry; Windows defaults to the compatible WPA2-Personal.

Will the created network disappear after restarting the computer?

Network settings (name and password) are saved permanently in the system. However, the distribution itself (status "started") stops after a reboot. You will need to restart your start_wifi.bat file so that the network can start broadcasting the signal.

Does this method affect internet speed?

Yes, the speed on connected devices will be lower than on the PC itself due to the overhead of encryption and packet processing by the processor, as well as the bandwidth limitations of the Wi-Fi adapter in emulation mode. Expect a loss of approximately 20-30% of the original cable speed.