Help creating .bat file to connect to my WiFi on startup

alex220372

Reputable
Feb 28, 2015
4
0
4,510
I recently purchased a WiFi adapter for my Windows 7 PC so I can connect Wireless instead of hardwire. Now every time I start my computer, or wake it up, I have to connect to my SSID and type in the code.

Can someone help me create a .bat file that will connect to my SSID and automatically enter the password on startup, so pretty much I don't have to do anything.

I am very computer savvy, but have never made a batch file before.

Assistance would be very much appreciated, and BTW, Google wasn't much help
 
netsh wlan stop hostednetwork
netsh wlan set hostednetwork ssid="WIFINAME"
netsh wlan set hostednetwork key=1234567890
netsh wlan start hostednetwork

Should do it, replacing wifiname and key with yours. I don't have any wifi in my pc, so can't test.

Though why your card won't connect or save the SSID, I don't know. Every wireless card I've ever had does that.

Also, make sure that you make a shortcut to your batch file, move it to your startup folder and right click on it and select run as admin, as those commands will need admin rights.
 

g90814

Honorable
Apr 11, 2013
1,382
1
11,960
Tell your computer to 'forget' your wireless connection.

Then, make sure you select the 'connect automatically' option when choosing and connecting to your network.
Example:
w704.png


Or, are you using some 3rd party wireless software?