PowerShell和批处理命令:
重置Internet协议(TCP / IP): PowerShell命令:Netsh int ip reset
批处理命令:netsh int ip reset
修复Winsock(重置目录): PowerShell命令:Netsh winsock reset
批处理命令:netsh winsock reset
更新Internet连接: PowerShell命令:ipconfig /renew
批处理命令:ipconfig /renew
清除DNS解析器缓存: PowerShell命令:Clear-DnsClientCache
批处理命令:ipconfig /flushdns
清除ARP缓存(地址解析协议): PowerShell命令和批处理命令:arp -d *
修复Internet Explorer 11: PowerShell命令和批处理命令:Start-Process "iexplore.exe" -ArgumentList "-extoff"
清除Windows更新历史记录: PowerShell命令:Clear-WindowsUpdate
批处理命令:net stop wuauserv && rd /s /q %systemroot%\SoftwareDistribution && net start wuauserv
修复Windows的自动更新: PowerShell命令:Install-Module PSWindowsUpdate | Import-Module; Get-WindowsUpdate; Install-WindowsUpdate
批处理命令:wuauclt /detectnow
修复SSL / HTTPS /密码学: PowerShell命令:Update-HostsFile
批处理命令:certutil -generateSSTFromWU roots.sst && certutil -addstore -f root roots.sst && del /q roots.sst
重置代理服务器配置: PowerShell命令:netsh winhttp reset proxy
批处理命令:netsh winhttp reset proxy
重置Windows防火墙配置: PowerShell命令:netsh advfirewall reset
批处理命令:netsh advfirewall reset
恢复默认的hosts文件: PowerShell命令和批处理命令:Copy-Item -Path "$env:windir\System32\drivers\etc\hosts.original" -Destination "$env:windir\System32\drivers\etc\hosts" -Force
更新WINS客户端注册: PowerShell命令和批处理命令:nbtstat -RR
在文件资源管理器中使网络计算机可见: PowerShell命令和批处理命令:Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
|
|
重置Internet协议(TCP/IP)
修复Winsock(重置目录)
更新Internet连接
刷新DNS解析器缓存(域名系统)
刷新ARP缓存(地址解析协议)
修复InternetExplorer11
清除Windows更新历史记录
修复Windows自动更新
修复SSL/HTTPS/加密
重置代理服务器配置
重置Windows防火墙配置
恢复默认hosts文件
更新Wins客户机注册
使网络计算机在文件资源管理器中可见
PowerShell 命令实现你提到的各项功能的脚本:
powershell
# 重置 Internet 协议 (TCP/IP)
netsh int ip reset
# 修复 Winsock
netsh winsock reset
# 更新 Internet 连接
ipconfig /flushdns
# 刷新 ARP 缓存
arp -d *
# 修复 Internet Explorer 11
$ie = New-Object -ComObject InternetExplorer.Application
$ie.Navigate("about:blank")
$ie.Quit()
# 清除 Windows 更新历史记录
Stop-Service wuauserv
Remove-Item -Path "$env:SystemRoot\SoftwareDistribution\DataStore\Logs\edb.log" -Force
Start-Service wuauserv
# 修复 Windows 自动更新
Unregister-ScheduledTask -TaskName "AUSessionCleanup" -TaskPath "\Microsoft\Windows\WindowsUpdate" -Confirm:$false
Unregister-ScheduledTask -TaskName "Scheduled Start" -TaskPath "\Microsoft\Windows\WindowsUpdate" -Confirm:$false
Unregister-ScheduledTask -TaskName "Automatic App Update" -TaskPath "\Microsoft\Windows\WindowsUpdate" -Confirm:$false
# 修复 SSL/HTTPS/加密
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Name "Start Page" -Force
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Name "Default_Page_URL" -Force
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Internet Explorer\Main" -Name "Default_Search_URL" -Force
# 重置代理服务器配置
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name "ProxyEnable" -Force
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name "ProxyServer" -Force
# 重置 Windows 防火墙配置
netsh advfirewall reset
# 恢复默认 hosts 文件
Copy-Item "$env:SystemRoot\System32\drivers\etc\hosts" "$env:SystemRoot\System32\drivers\etc\hosts.bak" -Force
Set-Content "$env:SystemRoot\System32\drivers\etc\hosts" "# localhost name resolution is handled within DNS`n# 127.0.0.1 localhost"
# 更新 Wins 客户端注册
nbtstat -R
nbtstat -RR
# 使网络计算机在文件资源管理器中可见
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoNetworkConnections" -Value 0
将以上代码保存为 .ps1 文件,然后右键以管理员身份运行即可执行。这个脚本将按照你指定的顺序执行各项操作。请注意,这些操作可能会影响系统配置,请谨慎执行。
|
@echo off
echo 正在重置 Internet 协议 (TCP/IP)...
netsh int ip reset resetlog.txt
echo 正在修复 Winsock...
netsh winsock reset
echo 正在更新 Internet 连接...
ipconfig /flushdns
echo 正在刷新 ARP 缓存...
arp -d *
echo 正在修复 Internet Explorer 11...
"%systemroot%\System32\ieframe.dll" -extoff
echo 正在清除 Windows 更新历史记录...
net stop wuauserv
del /q %systemroot%\SoftwareDistribution\DataStore\Logs\edb.log
net start wuauserv
echo 正在修复 Windows 自动更新...
schtasks /delete /tn "\Microsoft\Windows\WindowsUpdate\AUSessionCleanup" /f
schtasks /delete /tn "\Microsoft\Windows\WindowsUpdate\Scheduled Start" /f
schtasks /delete /tn "\Microsoft\Windows\WindowsUpdate\Automatic App Update" /f
echo 正在修复 SSL/HTTPS/加密...
reg delete "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /f
reg delete "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Default_Page_URL" /f
reg delete "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Default_Search_URL" /f
echo 正在重置代理服务器配置...
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /f
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /f
echo 正在重置 Windows 防火墙配置...
netsh advfirewall reset
echo 正在恢复默认 hosts 文件...
copy %SystemRoot%\System32\drivers\etc\hosts %SystemRoot%\System32\drivers\etc\hosts.bak
echo # localhost name resolution is handled within DNS >> %SystemRoot%\System32\drivers\etc\hosts
echo # 127.0.0.1 localhost >> %SystemRoot%\System32\drivers\etc\hosts
echo 正在更新 Wins 客户端注册...
nbtstat -R
nbtstat -RR
echo 完成!所有操作已执行。
pause
|
@echo off
echo 正在重置 Internet 协议 (TCP/IP)...
netsh int ip reset resetlog.txt
echo 正在修复 Winsock (重置目录)...
netsh winsock reset
echo 正在更新 Internet 连接...
ipconfig /release
ipconfig /renew
echo 正在刷新 DNS 解析器缓存 (域名系统)...
ipconfig /flushdns
echo 正在刷新 ARP 缓存 (地址解析协议)...
arp -d *
echo 正在修复 Internet Explorer 11...
start iexplore.exe "about:blank"
ping -n 2 127.0.0.1 > nul
taskkill /IM iexplore.exe /F
echo 正在清除 Windows 更新历史记录...
net stop wuauserv
del /Q /F %systemroot%\SoftwareDistribution\DataStore\Logs\edb.log
net start wuauserv
echo 正在修复 Windows 自动更新...
schtasks /Delete /TN "AUSessionCleanup" /F
schtasks /Delete /TN "Scheduled Start" /F
schtasks /Delete /TN "Automatic App Update" /F
echo 正在修复 SSL/HTTPS/加密...
REG DELETE "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /f
REG DELETE "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Default_Page_URL" /f
REG DELETE "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Default_Search_URL" /f
echo 正在重置代理服务器配置...
REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyEnable" /f
REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v "ProxyServer" /f
echo 正在重置 Windows 防火墙配置...
netsh advfirewall reset
echo 正在恢复默认 hosts 文件...
copy "%systemroot%\System32\drivers\etc\hosts" "%systemroot%\System32\drivers\etc\hosts.bak" /Y
echo 127.0.0.1 localhost > "%systemroot%\System32\drivers\etc\hosts"
echo 正在更新 Wins 客户端注册...
nbtstat -R
nbtstat -RR
echo 正在使网络计算机在文件资源管理器中可见...
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoNetworkConnections" /t REG_DWORD /d 0 /f
echo 所有任务已完成。
pause
将以上代码保存为 .bat 文件,然后右键以管理员身份运行即可执行。
|