Enable Scripts
# Define the registry key path
$registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Network Connections"
# Check if the Network Connections key exists, and create it if it doesn't
if (-not (Test-Path $registryPath)) {
New-Item -Path $registryPath -Force
}
# Create a DWORD value named "NC_ShowSharedAccessUI" and set it to 1 to enable the mobile hotspot
Set-ItemProperty -Path $registryPath -Name "NC_ShowSharedAccessUI" -Value 1
# Check if the Network Connections Settings key exists, and create it if it doesn't
$settingsPath = Join-Path $registryPath "Settings"
if (-not (Test-Path $settingsPath)) {
New-Item -Path $settingsPath -Force
}
# Create a DWORD value named "EnableMobileHotspot" and set it to 1 to enable the mobile hotspot
Set-ItemProperty -Path $settingsPath -Name "EnableMobileHotspot" -Value 1
# Restart the "Network Connections" service to apply the changes
Restart-Service -Name "NetMan"
0 Comments