This repository has been archived by the owner on Jun 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path5kblHotspotHelper.bat
131 lines (102 loc) · 2.61 KB
/
5kblHotspotHelper.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"
:setup
setlocal enableDelayedExpansion
color 70
IF NOT EXIST %appdata%\5kblHotspotFix (
mkdir %appdata%\5kblHotspotFix
echo.
)
cd %appdata%\5kblHotspotFix
IF not EXIST "hotspotstart.ps1" (
(
ECHO $connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile(^)
ECHO.
ECHO $tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile^)
ECHO.
ECHO $tetheringManager.StartTetheringAsync(^)
)>hotspotstart.ps1
echo.
echo The
)
IF NOT EXIST ".\interface.txt" (
echo.
echo ---WIRELESS INTERFACE SETUP---
echo.
netsh interface show interface
set /P "interface=Please copy-paste your wifi interface's name from the last column: "
echo.
echo !interface!>.\interface.txt
pause
cls
)
:menu
set /p "interfacename="<"interface.txt"
echo.
echo ---WINDOWS HOTSPOT FIX/SETUP---
echo.
echo Created by 5kbl.
echo.
echo Current Wireless Interface: %interfacename%
echo.
echo MENU:
echo [1] Turn on hotspot with fix - [2] Restore AutoConfig - [3] Change Wireless Interface - [4] Exit - [5] Uninstall
echo.
set /p Input=Choose(1/2/3/4/5):
If /I "%Input%"=="1" goto 1
If /I "%Input%"=="2" goto 2
If /I "%Input%"=="3" goto 3
If /I "%Input%"=="4" goto 4
If /I "%Input%"=="5" goto 5
goto other
:1
powershell .\hotspotstart.ps1
netsh wlan disconnect
timeout 2
netsh wlan set autoconfig enabled=no interface="%interfacename%"
pause
cls
goto menu
:2
netsh wlan set autoconfig enabled=yes interface="%interfacename%"
pause
cls
goto menu
:3
cls
echo.
echo ---WIRELESS INTERFACE SETUP---
echo.
echo Current interface: %interfacename%
echo.
netsh interface show interface
set /P "interface=Please copy-paste your wifi interface's name from the last column:"
echo.
echo !interface!>.\interface.txt
pause
cls
goto menu
:4
exit
:5
set /p uninstallchoice=Are you sure?(y/n):
If /I "%uninstallchoice%"=="y" goto y
goto n
:y
cls
cd %appdata%
rmdir /s /q "%appdata%\5kblHotspotFix"
echo Thanks for using 5kbl's Windows Hotspot Fix. Delete this script, and that's it. If you want to reinstall, simply run the script again.
pause
exit
:n
cls
goto menu
:other
echo.
echo Sorry, that's not an option!
echo.
pause
cls
goto menu