@echo off
color 2f
mode con cols=50 lines=30
title OKShare 【制作:wnsdt】
ver | findstr "6.">nul && set bulid=nt6 && goto sc_yhbl
ver | findstr "10.">nul && set bulid=nt10 && goto sc_yhbl
set bulid=nt5
:sc_yhbl
reg query "HKCU\Environment" /v temp >nul 2>nul||set "usertemp=%USERPROFILE%\" && goto sc_top
set usertemp=%temp%\
:sc_top
cls
del /q %temp%\info.txt>nul 2>nul
:sc_menu
echo.&echo.&echo.
echo 局域网共享一键修复 18.5.8
echo.
echo --------------------------------------------
echo.&echo.&echo.
echo 1、查看网络信息
echo.
echo 2、简单共享(无密码)
echo.
echo 3、密码共享
echo.
echo 4、共享和权限管理
echo.
echo 5、权限设置指南(图文)
echo.
echo 6、打印机共享指南(图文)
echo.
echo 7、更新与反馈
echo.&echo.&echo.&echo.&echo.
set select=
set str1=1234567
set /p select= 输入数字,按回车:
if not defined select goto sc_wrong
echo %select%|findstr "[%str1%]">nul||goto sc_wrong
if %select%==1 (goto sc_info)
if %select%==2 (goto sc_zd)
if %select%==3 (goto sc_sd)
if %select%==4 (goto sc_gl)
if %select%==5 (goto sc_help)
if %select%==6 (goto sc_print)
if %select%==7 (goto sc_update)
:sc_wrong
mshta vbscript:msgbox("只能输入1-7的数字",64,"提示")(window.close)
goto sc_top
:sc_info
cls
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo 正在处理信息....
if %bulid%==nt5 (goto sc_nt5) else (goto sc_nt6)
:sc_nt5
(echo.
echo.)>>%usertemp%info.txt
ping www.baidu.com -n 1 >nul || echo 互联网状态: [ 离线 ]>>%usertemp%info.txt && goto sc_ver_nt5
echo 互联网状态: [ 在线 ]>>%usertemp%info.txt
:sc_ver_nt5
(echo ----------------------------------------------------------
echo.)>>%usertemp%info.txt
for /f "skip=1 tokens=2-4 delims=, " %%a in ('wmic os get caption') do (
if exist %windir%\SysWOW64 echo 系统版本: %%a %%b %%c 64位>>%usertemp%info.txt & goto sc_ver_nt5_next
echo 系统版本: %%a %%b %%c 32位>>%usertemp%info.txt
)
:sc_ver_nt5_next
(echo.
echo 计算机名: %COMPUTERNAME%
echo.)>>%usertemp%info.txt
for /f "tokens=2 delims= " %%a in ('net config workstation^|findstr /c:"工作站域"') do echo 工作组: %%a>>%usertemp%info.txt & goto sc_info_nt5
:sc_info_nt5
(echo.
echo 当前用户: %USERNAME%
echo.)>>%usertemp%info.txt
for /f "delims=" %%a in ('date /t') do echo 本机日期: %%a>>%usertemp%info.txt
echo.>>%usertemp%info.txt
for /f "delims=" %%a in ('time /t') do echo 本机时间: %%a>>%usertemp%info.txt
echo ---------------------------------------------------------->>%usertemp%info.txt
goto sc_info_more
:sc_nt6
(echo.
echo.)>>%usertemp%info.txt
ping www.baidu.com -n 1 >nul || echo 互联网状态: [ 离线 ]>>%usertemp%info.txt && goto sc_ver_nt6
echo 互联网状态: [ 在线 ]>>%usertemp%info.txt
:sc_ver_nt6
(echo --------------------------------------------------
echo.)>>%usertemp%info.txt
for /f "skip=1 tokens=2-5 delims=?, " %%a in ('wmic os get caption') do (
if exist %windir%\SysWOW64 echo 系统版本: %%a %%b %%c %%d 64位>>%usertemp%info.txt & goto sc_ver_nt6_next
echo 系统版本: %%a %%b %%c %%d 32位>>%usertemp%info.txt
)
:sc_ver_nt6_next
(echo.
echo 计算机名: %COMPUTERNAME%
echo.)>>%usertemp%info.txt
for /f "tokens=2 delims= " %%a in ('net config workstation^|findstr /c:"工作站域"') do echo 工作组: %%a>>%usertemp%info.txt
(echo.
echo 当前用户: %USERNAME%
echo.)>>%usertemp%info.txt
for /f "delims=" %%a in ('date /t') do echo 本机日期: %%a>>%usertemp%info.txt
echo.>>%usertemp%info.txt
for /f "delims=" %%a in ('time /t') do echo 本机时间: %%a>>%usertemp%info.txt
echo -------------------------------------------------->>%usertemp%info.txt
:sc_info_more
if %bulid%==nt5 ipconfig /all|findstr /v /c:"Windows IP Configuration"|findstr /v /c:"Host Name"|findstr /v /c:"Primary Dns Suffix"|findstr /v /c:"Node Type"|findstr /v /c:"IP Routing Enabled"|findstr /v /c:"WINS Proxy Enabled">>%usertemp%info.txt && goto sc_info_next
ipconfig /all|findstr /v /c:"Windows IP 配置"|findstr /v /c:"主机名"|findstr /v /c:"主 DNS 后缀"|findstr /v /c:"节点类型"|findstr /v /c:"IP 路由已启用"|findstr /v /c:"WINS 代理已启用">>%usertemp%info.txt
:sc_info_next
start /w notepad %temp%\info.txt
del /q %temp%\info.txt>nul 2>nul
goto sc_top
:sc_zd
call :sc_qxfix
cls
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo 开始修复......
net user guest /active:yes>nul 2>nul
net user guest "">nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v forceguest /t REG_DWORD /d 0x1 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d 0x0 /f>nul 2>nul
goto sc_main
:sc_sd
call :sc_qxfix
cls
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo 开始修复......
net user guest /active:no>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v forceguest /t REG_DWORD /d 0x0 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" /v NtlmMinClientSec /t REG_DWORD /d 0x0 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" /v NtlmMinServerSec /t REG_DWORD /d 0x0 /f>nul 2>nul
goto sc_main
:sc_main
sc config LanmanWorkstation start= auto>nul 2>nul
sc config LanmanServer start= auto>nul 2>nul
sc config Winmgmt start= auto>nul 2>nul
sc config RpcSs start= auto>nul 2>nul
sc config Netman start= auto>nul 2>nul
sc config RasMan start= demand>nul 2>nul
sc config SSDPSRV start= auto>nul 2>nul
sc config BFE start= auto>nul 2>nul
sc config ALG start= demand>nul 2>nul
sc config SharedAccess start= auto>nul 2>nul
net start SharedAccess /y>nul 2>nul
sc config Browser start= auto>nul 2>nul
net start Browser /y>nul 2>nul
sc config Dnscache start= auto>nul 2>nul
net start Dnscache /y>nul 2>nul
sc config Dhcp start= auto>nul 2>nul
net start Dhcp /y>nul 2>nul
sc config lmhosts start= auto>nul 2>nul
net start lmhosts /y>nul 2>nul
sc config Spooler start= auto>nul 2>nul
net start Spooler /y>nul 2>nul
sc config upnphost start= demand>nul 2>nul
net start upnphost /y>nul 2>nul
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon" /v Start|findstr "0x4">nul 2>nul && sc config Netlogon start= demand>nul 2>nul
reg add "HKLM\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v TransportBindName /t REG_SZ /d \Device\ /f>nul 2>nul
reg delete "HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /v SMB1 /F>nul 2>nul
reg delete "HKLM\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /v SMB2 /F>nul 2>nul
reg delete "HKLM\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v SMBDeviceEnabled /F>nul 2>nul
sc config netbt start= system>nul 2>nul
net start netbt>nul 2>nul
if %bulid%==nt5 (goto sc_sernt5) else (goto sc_sernt6)
:sc_sernt5
sc config PlugPlay start= auto>nul 2>nul
sc config TapiSrv start= auto>nul 2>nul
sc config Nla start= auto>nul 2>nul
net start Nla /y>nul 2>nul
netsh firewall set opmode mode=disable>nul 2>nul
goto sc_main2_etc
:sc_sernt6
sc config DcomLaunch start= auto>nul 2>nul
sc config RpcEptMapper start= auto>nul 2>nul
sc config SamSs start= auto>nul 2>nul
sc config nsi start= auto>nul 2>nul
sc config SstpSvc start= demand>nul 2>nul
sc config MpsSvc start= auto>nul 2>nul
net start MpsSvc /y>nul 2>nul
sc config NlaSvc start= auto>nul 2>nul
sc config netprofm start= auto>nul 2>nul
sc config fdPHost start= auto>nul 2>nul
net start fdPHost /y>nul 2>nul
sc config FDResPub start= auto>nul 2>nul
net start FDResPub /y>nul 2>nul
sc config HomeGroupListener start= auto>nul 2>nul
sc config WMPNetworkSvc start= auto>nul 2>nul
net start WMPNetworkSvc /y>nul 2>nul
sc config HomeGroupProvider start= auto>nul 2>nul
net start HomeGroupProvider /y>nul 2>nul
netsh advfirewall set allprofiles state off>nul 2>nul
:sc_main2_etc
(echo [Unicode]
echo Unicode=yes
echo [Version]
echo signature="$CHICAGO$"
echo Revision=1
echo [Privilege Rights]
echo sedenynetworklogonright =
echo senetworklogonright = Everyone,Administrators,Users,Power Users,Backup Operators,guest)>>%usertemp%zcl.inf
secedit /configure /db %usertemp%zcl.sdb /cfg %usertemp%zcl.inf /log %usertemp%zcl.log /quiet
del /q %usertemp%zcl.*>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0" /v LmCompatibilityLevel /t REG_DWORD /d 0x1 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v restrictanonymous /t REG_DWORD /d 0x0 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v restrictanonymoussam /t REG_DWORD /d 0x0 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v everyoneincludesanonymous /t REG_DWORD /d 0x1 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v NoLmHash /t REG_DWORD /d 0x0 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /v AutoShareServer /t REG_DWORD /d 0x1 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /v AutoShareWks /t REG_DWORD /d 0x1 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" /v restrictnullsessaccess /t REG_DWORD /d 0x0 /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters" /v MaintainServerList /t REG_SZ /d Auto /f>nul 2>nul
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser\Parameters" /v IsDomainMaster /t REG_SZ /d FALSE /f>nul 2>nul
for /f "delims=" %%a in ('reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces" /s /e /f "0x2"^|findstr "\Tcpip_"') do reg add "%%a" /v NetbiosOptions /t REG_DWORD /d 0x0 /f>nul 2>nul
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v EnableLMHOSTS|findstr "0x0">nul 2>nul && reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v EnableLMHOSTS /t REG_DWORD /d 0x1 /f>nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RemoteComputer\NameSpace\{D6277990-4C6A-11CF-8D87-00AA0060F5BF}" /f>nul 2>nul
net use * /del /y>nul 2>nul
net config server /hidden:no>nul 2>nul
net share ipc$>nul 2>nul
if %bulid%==nt10 powershell -NonInteractive "Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol">nul 2>nul && reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v AllowInsecureGuestAuth /t REG_DWORD /d 0x1 /f>nul 2>nul
goto sc_tip
:sc_gl
cls
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v forceguest|findstr "0x1">nul 2>nul||goto classic
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v forceguest /t REG_DWORD /d 0x0 /f>nul 2>nul
set jlb=y
:classic
echo.&echo.&echo.&echo.
echo 功能:管理本机共享,修改共享权限
echo ----------------------------------------------
echo.&echo.&echo.&echo.&echo.
echo 【使用说明】
echo.&echo.
echo 点左侧“共享”可查看本机所有共享;
echo.
echo 右键点左侧“共享”可“新建共享”;
echo.
echo 右键点右侧共享可“停止共享”(能多选);
echo.
echo 右键点右侧共享选“属性”可修改权限;
echo.&echo.&echo.&echo.&echo.&echo.&echo.
fsmgmt.msc
if %jlb%==y reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" /v forceguest /t REG_DWORD /d 0x1 /f>nul 2>nul
goto sc_top
:sc_tip
cls
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo 修复已完成!!!
mshta vbscript:msgbox("请手动重启计算机",64,"提示")(window.close)
exit
:sc_help
cls
start "%ProgramFiles%\Internet Explorer\iexplore.exe" "https://zhuanlan.zhihu.com/p/24285252"
goto sc_top
:sc_print
cls
start "%ProgramFiles%\Internet Explorer\iexplore.exe" "https://zhuanlan.zhihu.com/p/24187152"
goto sc_top
:sc_update
cls
start "%ProgramFiles%\Internet Explorer\iexplore.exe" "https://zhuanlan.zhihu.com/p/24178142"
goto sc_top
goto :eof
:sc_qxfix
cls
echo.&echo.&echo.
echo 【使用说明】
echo --------------------------------------------
echo.
echo 复制共享文件夹的地址栏路径到下方
echo.
echo 如果只共享打印机,按回车键跳过
echo.&echo.&echo.&echo.&echo.&echo.&echo.
echo 粘贴路径,按回车:
echo.&echo.
set /p lj=
for %%a in ("%lj%") do set name=%%~na
net share "%name%"="%lj%">nul 2>nul
if %bulid%==nt5 cacls "%lj%" /t /e /p everyone:f >nul 2>nul && goto :eof
icacls "%lj%" /grant everyone:(oi)(ci)f>nul 2>nul
goto :eof

[转]局域网共享一键修复 18.5.8 https://zhuanlan.zhihu.com/p/24178142的更多相关文章

  1. 【基于WinForm+Access局域网共享数据库的项目总结】之篇三:Access远程连接数据库和窗体打包部署

    篇一:WinForm开发总体概述与技术实现 篇二:WinForm开发扇形图统计和Excel数据导出 篇三:Access远程连接数据库和窗体打包部署 [小记]:最近基于WinForm+Access数据库 ...

  2. [讨论] win7封装时如何直接开通局域网共享

    ekincheng 发表于 2016-10-31 20:17:54 https://www.itsk.com/thread-371838-1-5.html Win7封装时不能像XP那样直接开启局域网共 ...

  3. Boot Repair-能一键修复ubuntu启动/引导项的软件(告别命令行)

    如果你是windows+ubuntu的双系统,那么重装windows之后(非ghost 方式),是会直接进入windows的,之前的grub引导菜单会被抹掉,想要修复ubuntu的启动菜单的话,通常需 ...

  4. vpn局域网共享

    vpn局域网共享 更改网关为vpn共享主机地址 在“命令运行符”处,挨个键入下列命令,并回车生效: regsvr32 Softpub.dll regsvr32 Wintrust.dll regsvr3 ...

  5. Win7设置局域网共享

    Win7设置局域网共享 1. 把win7的guest用户开启. 打开win7的控制面板=>用户账号与安全=>用户账户=>管理其他用户=>点击guest用户,进行开启. 2.解决 ...

  6. 纯净版xp系统在局域网共享需要密码如何解决

    纯净版xp系统在局域网共享需要密码怎么办?这是近来不少朋友都向小编反馈的问题.他们表示每次共享者更改密码后其他人都需要再重新输入密码,感觉十分的麻烦.下面是系统城小编给大家整理的一些有关XP系统局域网 ...

  7. WIN10局域网共享,经常出现无法访问的现象的解决方法

    WIN10的局域网共享是真操蛋啊,用着好好的,重启了一下,突然就不好用了,其他人无法访问我的电脑,百度了半天也没有找到能解决的访问,文章中说的都试过了,该开启的也都开启了,防火墙也关了,没用,后来想着 ...

  8. 图解WinXP局域网共享设置步骤

    原文链接地址:http://blog.csdn.net/jackinzhou/article/details/8468208 第一章:共享的前提工作 1.更改不同的计算机名,设置相同的工作组! 2.我 ...

  9. webstrom配置一键修复ESLint的报错

    因为项目本身有用eslint,而我这边没用,我这边提交上去别人update后就会提示很多eslint的格式错误提示,所以就在该项目里使用了eslint. 发现一般有两种安装方式,我使用的是webstr ...

随机推荐

  1. python安装pip和使用pip安装Python库类比如pip安装beautifulsoup4

    初学Python时,看到很多不懂得东西,比如 pip, 是python 包管理工具,pip是easy_install的取代. Distribute是对标准库disutils模块的增强,我们知道disu ...

  2. 《Android源码设计模式》--装饰模式

    No1: Activity继承于ContextThemeWrapper,继承于ContextWrapper,继承于Context. No2: Context中方法的所有实现均由ContextImpl类 ...

  3. R语言编程艺术(1)快速入门

    这本书与手上其他的R语言参考书不同,主要从编程角度阐释R语言,而不是从统计角度.因为之前并没有深刻考虑这些,因此写出的代码往往是一条条命令的集合,并不像是“程序”,因此,希望通过学习这本书,能提高编程 ...

  4. @Resource与@Autowired注解的区别(转)

    Spring不但支持自己定义的@Autowired注解,还支持由JSR-250规范定义的几个注解.如:@Resource.@PostConstruct及@PreDestroy 1.@Autowired ...

  5. Bzoj5294/洛谷P4428 [Bjoi2018]二进制(线段树)

    题面 Bzoj 洛谷 题解 考虑一个什么样的区间满足重组之后可以变成\(3\)的倍数.不妨设\(tot\)为一个区间内\(1\)的个数.如果\(tot\)是个偶数,则这个区间一定是\(3\)的倍数,接 ...

  6. [ 转载 ] Java开发中的23种设计模式详解(转)

    Java开发中的23种设计模式详解(转)   设计模式(Design Patterns) ——可复用面向对象软件的基础 设计模式(Design pattern)是一套被反复使用.多数人知晓的.经过分类 ...

  7. luoguP4279 [SHOI2008]小约翰的游戏 Anti-SG 博弈论

    这就是一个Anti SG问题 当整个游戏的\(sg = 0\)时,如果不存在单一游戏局面\(sg > 1\),那么先手必胜 当整个游戏的\(sg \neq 0\)时,如果至少存在一个单一游戏局面 ...

  8. [HDU6198]number number number

    题目大意: 给定一个数k表示你可以从包括0的斐波那契数列中任取k个数,得到它们的和.求最小的不能得到的自然数. 思路: 打表找规律,可以发现答案为f(2k+3)-1,然后用公式f(i)=f(i/2)* ...

  9. Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) B. Problems for Round 水题

    B. Problems for Round 题目连接: http://www.codeforces.com/contest/673/problem/B Description There are n ...

  10. codevs 1063 合并果子 STL 优先队列

    1063 合并果子 Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codevs.cn/problem/1063/ Description 在一 ...