Я пытаюсь использовать netsh для экспорта, а затем импортировать мои настройки сети. Мне удалось экспортировать мои настройки с помощью команды:
netsh -c interface dump > c:\settings.txt
Файл создан, все в порядке, но когда я пытаюсь импортировать файл, используя:
netsh -f c:\settings.txt
Я получаю следующее:
Resetting Global, OK!
Resetting , failed.
Access is denied.
Restart the computer to complete this action.
Resetting Interface, OK!
Resetting , failed.
Access is denied.
Restart the computer to complete this action.
The following command was not found: reset.
Reset of all TCP parameters OK!
The congestionprovider parameter can be set using the
'netsh int tcp set supplemental' command.
The parameter is incorrect.
The following command was not found: reset.
Я использую командную строку с правами администратора в Windows 8.
Мне это нужно, потому что я работаю из большего количества мест, и в одном из них мне нужно установить некоторые настройки прокси-сервера, и я хотел как-то автоматизировать это.
РЕДАКТИРОВАТЬ: Это файл настроек:
#========================
# Interface configuration
#========================
pushd interface
popd
# End of interface configuration
# ----------------------------------
# IPHTTPS Configuration
# ----------------------------------
pushd interface httpstunnel
reset
popd
# End of IPHTTPS configuration
# ----------------------------------
# IPv4 Configuration
# ----------------------------------
pushd interface ipv4
reset
set global icmpredirects=enabled
popd
# End of IPv4 configuration
# ----------------------------------
# IPv6 Configuration
# ----------------------------------
pushd interface ipv6
reset
set interface interface="Ethernet" forwarding=enabled advertise=enabled nud=enabled ignoredefaultroutes=disabled
set interface interface="Wi-Fi" forwarding=enabled advertise=enabled nud=enabled ignoredefaultroutes=disabled
set interface interface="Bluetooth Network Connection" forwarding=enabled advertise=enabled nud=enabled ignoredefaultroutes=disabled
set interface interface="(my proxy goes here)" forwarding=enabled advertise=enabled nud=enabled ignoredefaultroutes=disabled
set interface interface="Teredo Tunneling Pseudo-Interface" forwarding=enabled advertise=enabled mtu=1280 nud=enabled ignoredefaultroutes=disabled
set interface interface="Local Area Connection* 12" forwarding=enabled advertise=enabled nud=enabled ignoredefaultroutes=disabled
set interface interface="isatap.{A049BA26-6AB7-4880-9D9C-1CD3E579C8E0}" forwarding=enabled advertise=enabled nud=enabled ignoredefaultroutes=disabled
set interface interface="isatap.{1B39EAEE-CBD8-406C-928F-FB0F83DC49E5}" forwarding=enabled advertise=enabled nud=enabled ignoredefaultroutes=disabled
popd
# End of IPv6 configuration
# ----------------------------------
# ISATAP Configuration
# ----------------------------------
pushd interface isatap
popd
# End of ISATAP configuration
# ----------------------------------
# 6to4 Configuration
# ----------------------------------
pushd interface 6to4
reset
popd
# End of 6to4 configuration
# ----------------------------------
# ISATAP Configuration
# ----------------------------------
pushd interface isatap
popd
# End of ISATAP configuration
#========================
# Port Proxy configuration
#========================
pushd interface portproxy
reset
popd
# End of Port Proxy configuration
# ----------------------------------
# TCP Configuration
# ----------------------------------
pushd interface tcp
reset
set global rss=enabled chimney=disabled autotuninglevel=normal congestionprovider=none ecncapability=disabled timestamps=disabled netdma=disabled dca=disabled initialrto=3000 rsc=enabled
popd
# End of TCP configuration
# ----------------------------------
# Teredo Configuration
# ----------------------------------
pushd interface teredo
set state type=client servername=teredo.ipv6.microsoft.com. servervirtualip=0.0.0.0
popd
# End of Teredo configuration
# ----------------------------------
# 6to4 Configuration
# ----------------------------------
pushd interface 6to4
reset
popd
# End of 6to4 configuration