win 无线热点setup

来源:互联网 发布:sql server 大数据 编辑:程序博客网 时间:2024/06/04 14:23


本脚本用于(setup.bat):

(1)建立无线热点

(2)查看保存的无线账号(密码)[高版本的win默认不支持图形化界面查看密码]

(3)搜索附近可用的无线账号


@echo offcls:MENUecho ============================================echo                 SET UP WIFI HOT echo ============================================echo 1.clear historyecho 2.set hostednetworkecho 3.start hostednetworkecho 4.stop hostednetworkecho 5.show saved ssid info(pwd)echo 6.show ssid availableecho.set /p OPTION=Please Chose Option:if %OPTION%==1 goto clear_historyif %OPTION%==2 goto set_hostednetwork if %OPTION%==3 goto start_hostednetworkif %OPTION%==4 goto stop_hostednetworkif %OPTION%==5 goto show_saved_ssid_pwdif %OPTION%==6 goto show_ssid_available:clear_history%=================================================%clsgoto MENU%=================================================%:set_hostednetwork%=================================================%echo "set hostednetwork"netsh wlan start hostednetworknetsh wlan set hostednetwork mode=allow ssid=zhouat_wifi key=12341234 keyusage=persistentif errorlevel 1 goto MENUecho "ssid=zhouat_wifi key=12341234"ncpa.cpl  %open net share center%goto MENU%=================================================%:start_hostednetwork%=================================================%echo "start hostednetwork"netsh wlan start hostednetworkgoto MENU%=================================================%:stop_hostednetwork%=================================================%echo "stop hostednetwork"netsh wlan set hostednetwork mode=disallownetsh wlan stop hostednetworkgoto MENU%=================================================%:show_saved_ssid_pwd%=================================================%echo "netsh wlan show profile zxs key=clear"netsh wlan show profile goto MENU%=================================================%:show_ssid_available%=================================================%echo "netsh wlan show networks"netsh wlan show networks goto MENU%=================================================%



Show the list of wireless profiles: 
netsh wlan show profiles

Retrieve the stored key (WPA, WEP, etc) of a profile: 
netsh wlan show profiles name=[profile name] key=clear

Delete a wireless profile: 
netsh wlan delete profile name=[profile name]

Set a network’s priority: 
netsh wlan set profileorder name=[profile name]interface=[interface_name] priority=1

Stop automatically connecting to a network: 
netsh wlan set profileparameter name=[profile name] connectionmode=manual

Though you can’t actually make changes to the network profiles themselves, you can export a desired profile, make changes to the XML file, and then import the profile back onto the same machine or another one.

In Windows 8, Microsoft also removed the ability to save/export the network profiles from the GUI in the Wireless Network Properties box under the Connection tab. However, it’s still possible via Netsh commands:

Export a wireless network profile: 
netsh wlan export profile name=[profile name]

Import a network profile:
netsh wlan add profile filename=[path_and_filename.xml] interface=[interface_name]

Creating an Ad Hoc Wireless Connection

Starting with Windows 8, Microsoft also removed the ability to create ad hoc or peer-to-peer wireless networks. You won’t find the "Set up a wireless ad hoc option" under "Set up a new connection or network" anymore in the GUI. However, you can utilize what Microsoft calls Wireless Hosted Networks via Netsh commands:

Configure the Wireless Hosted Network: 
netsh wlan set hostednetwork mode=allow ssid=[your_virtual_network_name] key=[your_network_password]

Enable the Wireless Hosted Network: 
netsh wlan start hostednetwork

Disable the Wireless Hosted Network: 
netsh wlan stop hostednetwork

Retrieve the Wireless Hosted Network details: 
netsh wlan show hostednetwork

Change the password: 
netsh wlan refresh hostednetwork YourNewNetworkPassword

Before users on the ad hoc network can access the Internet via the Wireless Hosted Network, you must enable Internet Connection Sharing (ICS). Open the Network and Sharing Center, open the Network Connections, right-click the network adapter that’s connected to the Internet, and select Properties.

Then select the Sharing tab, check Allow other network users to connect through this computer’s Internet connection, and then choose the Wireless Hosted Network Connection from the drop-down listbox, and click OK

0 0