0% found this document useful (0 votes)
30 views2 pages

Batch For Enable Disable Network Settings

The document provides a series of commands for managing network adapters using the command prompt, including enabling and disabling specific adapters. It also includes a script for checking administrative privileges and setting proxy settings based on user choices. The user can choose between two network configurations, with corresponding commands to enable or disable adapters and manage proxy settings.

Uploaded by

Anand Sachan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Batch For Enable Disable Network Settings

The document provides a series of commands for managing network adapters using the command prompt, including enabling and disabling specific adapters. It also includes a script for checking administrative privileges and setting proxy settings based on user choices. The user can choose between two network configurations, with corresponding commands to enable or disable adapters and manage proxy settings.

Uploaded by

Anand Sachan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

In the elevated command prompt, copy and paste the command below, and press Enter.

This will show you all network adapter names on your PC.

netsh interface show interface

netsh interface set interface "network_adapter_name" admin=enable


(e.g netsh interface set interface "MyEthernet" admin=enable)

netsh interface set interface "network_adapter_name" admin=disable


(e.g netsh interface set interface "MyEthernet" admin=disable)

netsh interface set interface �Wi-Fi 12� disable


netsh interface set interface "network_adapter_name" admin=enable

netsh interface set interface �Wi-Fi 12� enable

echo off
@echo off
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
Setlocal EnableDelayedExpansion
cls
:start
echo Choice 1 For Using Tenda WI-FI and Disable Proxy Settings
echo Choice 2 For Using JIL Network and Enable Proxy Settings
set /p choice=Yes or No?
if '%Choice%'=='1' goto :choice1
if '%Choice%'=='2' goto :choice2
echo "%Choice%" is not a valid option. Please try again.
echo
goto start
:choice1
netsh interface set interface "Ethernet" admin=disable
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v
ProxyEnable /t REG_DWORD /d 0 /f
timeout /t 5
netsh interface set interface �Wi-Fi 12� admin=enable
goto end
:end
pause
exit
:choice2
netsh interface set interface �Wi-Fi 12� admin=disable
timeout /t 5
netsh interface set interface "Ethernet" admin=Enable
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v
ProxyEnable /t REG_DWORD /d 1 /f
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v
ProxyServer /t REG_SZ /d 172.16.4.94:8080 /f
taskkill /F /IM chrome.exe /T > nul
start chrome "www.google.co.in"
goto end
:end
pause
exit

to disable Proxy
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v
ProxyEnable /t REG_DWORD /d 0 /f

@echo off
netsh winhttp reset proxy

You might also like