Latest posts by Michael Pietroforte (see all)
- Enabling PowerShell remoting fails due to Public network connection type - Thu, Sep 14 2017
- Set default Office 365 mailbox send and receive size limits - Mon, Sep 11 2017
- Change maximum Office 365 attachment size with PowerShell - Thu, Aug 31 2017
Considering that more and more users want to connect their mobile devices to the Internet at work, offering Wi-Fi is now a must in many organizations. If you only have LAN in your offices, it can get quite expensive if you have to install Wi-Fi routers everywhere in the building. A cheaper solution is to use Windows PCs as hotspots. I use the setup explained here when I connect my laptop to a hotel LAN to share Internet with my phone.
My first idea was to put in the Windows startup folder a batch script containing the command that starts the hotpot. The problem is that the netsh command needs administrator privileges and has to be elevated. I described in the 4sysops forum how to do this at startup; however, it is all a bit longwinded.
A reader reminded me of a much better way. You can leverage the powerful Windows Task Scheduler, one of the many great features introduced with Windows Vista. With the solution described here, you only have to switch on the Windows machine you want to use as a hotspot; the user of the PC doesn’t need admin rights, and nobody needs to log on.
Note: Before you follow the step-by-step guide below, you must perform, at least once, the steps in my guide for how to share Wi-Fi in Windows 8.
- Create a batch file with the contents below (you might want to change the security key) and store it in the location of your choice:12netsh wlan set hostednetwork mode=allow ssid=hotspot key=12345678 keyUsage=persistentnetsh wlan start hostednetwork
- Type Task… on the Windows 8 Start screen and then run the Task Scheduler.
- Click Create Task in the Actions pane on the right hand side.
- Enter Hotspot as the name for the task, and select Run whether user is logged on or not and Run with highest privileges. Select a user account with administrator rights under When running the task, use the following user account. You will have to enter the password after you confirmed the account.
- On the Trigger tab, click New, select At startup under Begin the task, and then click OK.
- On the Action tab, click New, select Start a program as Action, choose the batch file you created in step 1, and click OK.
- On the Conditions tab, deselect Start the task only if the computer is on AC power (just to be sure, if the hotspot is a laptop or tablet), and click OK.
You should now see your new task in the Task Scheduler Library. After you reboot, your Windows 8 machine acts like a Wi-Fi hotspot. If it doesn't work, you can Enable All Tasks History in the right pane of the Task Scheduler. The History tab of the task will help you to troubleshoot.
Hotspot in Task Manager
You can also do something similar with a Group Policy startup script.