Ad Code

Responsive Advertisement

Ticker

6/recent/ticker-posts

Window Hostspot Enable or Disable Scripts

 


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"




Disable 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 0 to disable the mobile hotspot
Set-ItemProperty -Path $registryPath -Name "NC_ShowSharedAccessUI" -Value 0

# 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 0 to disable the mobile hotspot
Set-ItemProperty -Path $settingsPath -Name "EnableMobileHotspot" -Value 0

# Restart the "Network Connections" service to apply the changes
Restart-Service -Name "NetMan"

Post a Comment

0 Comments

Ad Code

Responsive Advertisement