批处理V2.2版本 打印机共享修复脚本
本帖最后由 Love0912 于 2024-10-14 09:56 编辑先看代码:
@echo off
rem 以下为可编辑区域,仅动“=”后面的参数
set 服务器主机端IP=192.168.0.241
set 服务器主机端用户名=Administrator
set 服务器主机端密码=""
rem可编辑区域结束,以下代码不要动,以免报错
rem 以下为可来宾账户编辑区域,仅动“=”后面的参数;非特殊情况,可以忽略不修改!!
set guest服务器主机端用户名=GUEST
set guest服务器主机端密码=""
rem可编辑区域结束,以下代码不要动,以免报错
setlocal enabledelayedexpansion
:Variables
set InputPrompt=请输入密钥以继续:
set CorrectKeyMsg=密钥正确,继续执行...
set WrongKeyMsg=密钥错误,请重新输入或按X键退出...
set RetryPrompt=是否重新输入(Y/N)?:
set InvalidInputMsg=无效输入,请重新选择...
:PasswordLoop
set /p UserKey=!InputPrompt!
if "%UserKey%"=="erhudiannao" (
echo !CorrectKeyMsg!
goto start
) else (
echo !WrongKeyMsg!
set /p Choice=!RetryPrompt!
if /i "%Choice%"=="Y" goto PasswordLoop
if /i "%Choice%"=="X" goto EndScript
echo !InvalidInputMsg!
goto PasswordLoop
)
:start
cls
ipconfig | find /i "ipv4"
echo.
echo.强烈建议先看程序帮助。。。
echo.
echo 二虎电脑 凭证管理器
echo ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
echo.┋
echo ┋ 〖1.查看凭据〗 〖2.创建WINDOS凭据〗 〖3.创建普通凭据〗
echo ┋ 〖4.删除现有凭据〗 〖5.删除RAS凭据〗 〖6.开启RPC端口〗┋
echo.┋ 〖7.添加来宾账户到WINDOS凭据〗 〖8.添加来宾账户到普通凭据凭据〗
echo.┋ 〖9.一键开启来宾账户权限〗 〖0.一键关闭来宾账户权限〗
echo.┋
echo.┋ ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┋
echo ┋ ┋ Z.退出程序┋ M.程序帮助┋ X.视频教程┋
echo.╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝
:cho
set choice=
set /p choice= 请输入对应的按回车:
IF NOT "%Choice%"=="" SET Choice=%Choice:~0,1%
if /i "%choice%"=="1" goto ckpj
if /i "%choice%"=="2" goto cjypj
if /i "%choice%"=="3" goto cjptpj
if /i "%choice%"=="4" goto scxypj
if /i "%choice%"=="5" goto scraspj
if /i "%choice%"=="6" goto zjrcpdk
if /i "%choice%"=="7" goto cjypjguest
if /i "%choice%"=="8" goto cjptpjguest
if /i "%choice%"=="9" goto kqlbzh
if /i "%choice%"=="0" goto gblbzh
if /i "%choice%"=="m" goto cxjj
if /i "%choice%"=="Z" goto end
if /i "%choice%"=="X" goto spjc
echo 选择无效,请重新输入
echo.
goto cho
:ckpj
cls
cmdkey /list
pause >nul
goto start
:cjypj
cls
cmdkey /add:%服务器主机端IP% /user:%服务器主机端用户名% /pass:%服务器主机端密码%
pause >nul
goto start
:cjptpj
cls
cmdkey /generic:%服务器主机端IP% /user:%服务器主机端用户名% /pass:%服务器主机端密码%
pause >nul
goto start
rem以下代码为来宾账户信息,便于检查故障
:cjypjguest
cls
cmdkey /add:%服务器主机端IP% /user:%guest服务器主机端用户名% /pass:%guest服务器主机端密码%
pause >nul
goto start
:cjptpjguest
cls
cmdkey /generic:%服务器主机端IP% /user:%guest服务器主机端用户名% /pass:%guest服务器主机端密码%
pause >nul
goto start
:kqlbzh
cls
net user guest /active:yes
net localgroup "Remote Desktop Users" /add GUEST
regedit /s 开通局域网共享(访问本机无需验证即可进入).reg
pause >nul
goto start
:gblbzh
cls
net user guest /active:no
pause >nul
goto start
:scxypj
cls
cmdkey /delete:%服务器主机端IP%
pause >nul
goto start
:scraspj
cls
cmdkey /delete /ras
pause >nul
goto start
:zjrcpdk
cls
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\RPC" /v RpcUseNamedPipeProtocol /t REG_DWORD /d 1 /f
pause >nul
goto start
:spjc
cls
start "" "https://www.douyin.com/user/self?from_tab_name=main&modal_id=7420375072235474191&showTab=post"
goto start
:cxjj
echo _______________________________________________________________
echo 特别鸣谢二虎电脑编写此程序
echo.
echo 此程序旨在快速部署系统凭据,以下为简单实用方法
echo.
echo 1、此程序上点击右键选择编辑,找到服务器主机端位置,修改为服务器参数
echo.
echo 2、保存并以管理员身份运行
echo.
echo 3、先运行6选项开启端口,然后根据需要创建凭证即可
echo.
echo 4、一般情况下使用默认的用户名即可,特殊情况可以选择修改并使用来宾账户信息(记得开启来宾权限)
echo.
echo 如果还是不行,参考打包文件中的帮助文档以及对应的解决工具。
echo.
echo 如有其它问题可以私信我, V搜不易展示,隐藏了即可
echo.
echo 本程序版权归二虎电脑所有,请勿擅自传播商用
echo ____________________________________________________________________
pause >nul
goto start
本来按我最初的计划,是将出了开头部分{就是主机端IP、用户名、密码}进行展示用以支持用户自行修改外,其他地方全部隐藏或使其无法被正常读取,用来防止用户自行修改破坏其完整性,但是尝试了一些方法都没有成功,又不想拆分成多个处理器{便携性真的很重要啊。。}
所以最后退而求其次,走了这种方法,把支持用户修改的地方,放在最上方,然后中间放一堆小白看不懂的代码,让他们不敢随便动。。。暂时只能这样了
然后为了防止盗版,我还在中间串了很多其他的小坑,比如底部的文字帮助说明,以及视频外链等,这样都是一些不错的防盗版手段(虽然对有一点技术的人来说卵用没用~)
其他还有什么可以改进或者优化的地方,请各位大佬不吝赐教、批评
额,最后的最后,很多大佬说为啥不用C#或者易语言写,那样更简单 明了,,我也懂 ,,奈何不会呀,,本来是个硬件工程师,编程底子比较薄,慢慢来吧,总会好起来的,有啥简单易上手的编程软件大佬们也可以推荐推荐,
不需要太高级的功能,我一般用到的功能基本上就是这个批处理写的这种编程水平了,最基础版本的就足够了,哈哈~ 本帖最后由 kissfox 于 2024-10-14 15:09 编辑
整理合并了下
去除了秘钥
@echo off
color 2f
mode con cols=80 lines=40
ver | findstr "6.1">nul && set bulid=nt6 && goto sc_top
ver | findstr "10.">nul && set bulid=nt10 && goto sc_top
ver | findstr "5.">nul && set bulid=nt5 && goto sc_top
ver | findstr "6.3">nul && set bulid=nt10 && goto sc_top
ver | findstr "6.2">nul && set bulid=nt10 && goto sc_top
echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
rem 以下为可编辑区域,仅动“=”后面的参数
set 服务器主机端IP=10.10.8.88
set 服务器主机端用户名=Administrator
set 服务器主机端密码=""
rem可编辑区域结束,以下代码不要动,以免报错
rem 以下为可来宾账户编辑区域,仅动“=”后面的参数;非特殊情况,可以忽略不修改!!
set guest服务器主机端用户名=GUEST
set guest服务器主机端密码=""
rem可编辑区域结束,以下代码不要动,以免报错
setlocal enabledelayedexpansion
:sc_top
cls
del /q %temp%\info.txt>nul 2>nul
:start
cls
echo.&echo.&echo.
echo.
echo.
echo 凭证管理器
echo ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
echo. ┋ ┋
echo ┋ 〖1.查看本机信息〗 ┋
echo ┋ 〖2.查看凭据〗 ┋
echo ┋ 〖3.创建WINDOS凭据〗 ┋
echo ┋ 〖4.创建普通凭据〗 ┋
echo ┋ 〖5.删除现有凭据〗 ┋
echo ┋ 〖6.删除RAS凭据〗 ┋
echo ┋ 〖7.开启RPC端口〗 ┋
echo ┋ 〖8.添加来宾账户到WINDOS凭据〗 ┋
echo ┋ 〖9.添加来宾账户到普通凭据凭据〗 ┋
echo ┋ 〖0.一键开启来宾账户权限〗 ┋
echo ┋ 〖a.一键关闭来宾账户权限〗 ┋
echo ┋ 〖b.卸载更新补丁〗 ┋
echo ┋ 〖c.简单共享(无密码)〗 ┋
echo ┋ 〖d.密码共享〗 ┋
echo ┋ 〖e.共享和权限管理〗 ┋
echo ┋ 〖f.权限设置指南(图文)〗 ┋
echo ┋ 〖g.打印机共享指南(图文)〗 ┋
echo ┋ 〖h.更新与反馈〗 ┋
echo. ┋ ┋
echo. ┋ ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┋
echo ┋ ┋ X.视频教程 ┋ y.程序帮助 ┋ Z.退出程序 ┋
echo. ╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝
echo.强烈建议先看程序帮助。。。
echo.强烈建议先看程序帮助。。。
echo.强烈建议先看程序帮助。。。
:cho
set choice=
set /p choice= 请输入对应的按回车:
IF NOT "%Choice%"=="" SET Choice=%Choice:~0,1%
if /i "%choice%"=="1" goto sc_info
if /i "%choice%"=="2" goto ckpj
if /i "%choice%"=="3" goto cjypj
if /i "%choice%"=="4" goto cjptpj
if /i "%choice%"=="5" goto scxypj
if /i "%choice%"=="6" goto scraspj
if /i "%choice%"=="7" goto zjrcpdk
if /i "%choice%"=="8" goto cjypjguest
if /i "%choice%"=="9" goto cjptpjguest
if /i "%choice%"=="0" goto kqlbzh
if /i "%choice%"=="a" goto gblbzh
if /i "%choice%"=="b" goto scgxbd
if /i "%choice%"=="c" goto sc_zd
if /i "%choice%"=="d" goto sc_sd
if /i "%choice%"=="e" goto sc_gl
if /i "%choice%"=="f" goto sc_help
if /i "%choice%"=="g" goto sc_print
if /i "%choice%"=="h" goto sc_update
if /i "%choice%"=="X" goto spjc
if /i "%choice%"=="y" goto cxjj
if /i "%choice%"=="Z" goto end
echo 选择无效,请重新输入
echo.
goto cho
:ckpj
cls
cmdkey /list
pause >nul
goto start
:cjypj
cls
cmdkey /add:%服务器主机端IP% /user:%服务器主机端用户名% /pass:%服务器主机端密码%
pause >nul
goto start
:cjptpj
cls
cmdkey /generic:%服务器主机端IP% /user:%服务器主机端用户名% /pass:%服务器主机端密码%
pause >nul
goto start
rem以下代码为来宾账户信息,便于检查故障
:cjypjguest
cls
cmdkey /add:%服务器主机端IP% /user:%guest服务器主机端用户名% /pass:%guest服务器主机端密码%
pause >nul
goto start
:cjptpjguest
cls
cmdkey /generic:%服务器主机端IP% /user:%guest服务器主机端用户名% /pass:%guest服务器主机端密码%
pause >nul
goto start
:kqlbzh
cls
net user guest /active:yes
net localgroup "Remote Desktop Users" /add GUEST
regedit /s 开通局域网共享(访问本机无需验证即可进入).reg
pause >nul
goto start
:gblbzh
cls
net user guest /active:no
pause >nul
goto start
:scxypj
cls
cmdkey /delete:%服务器主机端IP%
pause >nul
goto start
:scraspj
cls
cmdkey /delete /ras
pause >nul
goto start
:zjrcpdk
cls
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\RPC" /v RpcUseNamedPipeProtocol /t REG_DWORD /d 1 /f
pause >nul
goto start
:scgxbd
@echo off
@wusa /quiet /uninstall /kb:5006670
@wusa /quiet /uninstall /kb:5006667
@wusa /quiet /uninstall /kb:5006672
@wusa /quiet /uninstall /kb:5006669
@wusa /quiet /uninstall /kb:5006675
@echo off
@echo 卸载完成
pause >nul
goto start
:spjc
cls
start "" "https://www.douyin.com/user/self?from_tab_name=main&modal_id=7420375072235474191&showTab=post"
goto start
:cxjj
echo ----------------------------------------------------------------------------------------------------
echo.
echo 此程序旨在快速部署系统凭据,以下为简单实用方法
echo.
echo 1、此程序上点击右键选择编辑,找到服务器主机端位置,修改为服务器参数
echo.
echo 2、保存并以管理员身份运行
echo.
echo 3、先运行6选项开启端口,然后根据需要创建凭证即可
echo.
echo 4、一般情况下使用默认的用户名即可,特殊情况可以选择修改并使用来宾账户信息(记得开启来宾权限)
echo.
echo 5、如果还是不行,参考打包文件中的帮助文档以及对应的解决工具。
echo.
echo 6、如有其它问题可以私信我, V搜不易展示,隐藏了即可
echo.
echo 7、本程序版权归二虎电脑所有,请勿擅自传播商用
echo ----------------------------------------------------------------------------------------------------
pause >nul
goto start
: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.)>>%temp%\info.txt
ping www.baidu.com -n 1 >nul || echo 互联网状态: [ 离线 ]>>%temp%\info.txt && goto sc_ver_nt5
echo 互联网状态: [ 在线 ]>>%temp%\info.txt
:sc_ver_nt5
(echo ----------------------------------------------------------
echo.)>>%temp%\info.txt
for /f "skip=1 tokens=2-4 delims=, " %%a in ('wmic os get caption') do (
if exist %windir%\SysWOW64 echo 系统版本: %%a %%b %%c64位>>%temp%\info.txt & goto sc_ver_nt5_next
echo 系统版本: %%a %%b %%c32位>>%temp%\info.txt
)
:sc_ver_nt5_next
(echo.
echo 计算机名: %COMPUTERNAME%
echo.)>>%temp%\info.txt
for /f "tokens=2 delims= " %%a in ('net config workstation^|findstr /c:"工作站域"') do echo 工作组: %%a>>%temp%\info.txt & goto sc_info_nt5
:sc_info_nt5
(echo.
echo 当前用户: %USERNAME%
echo.)>>%temp%\info.txt
for /f "delims=" %%a in ('date /t') do echo 本机日期: %%a>>%temp%\info.txt
echo.>>%temp%\info.txt
for /f "delims=" %%a in ('time /t') do echo 本机时间: %%a>>%temp%\info.txt
echo ---------------------------------------------------------->>%temp%\info.txt
goto sc_info_more
:sc_nt6
(echo.
echo.)>>%temp%\info.txt
ping www.baidu.com -n 1 >nul || echo 互联网状态: [ 离线 ]>>%temp%\info.txt && goto sc_ver_nt6
echo 互联网状态: [ 在线 ]>>%temp%\info.txt
:sc_ver_nt6
(echo ----------------------------------------------------------
echo.)>>%temp%\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位>>%temp%\info.txt & goto sc_ver_nt6_next
echo 系统版本: %%a %%b %%c %%d 32位>>%temp%\info.txt
)
:sc_ver_nt6_next
(echo.
echo 计算机名: %COMPUTERNAME%
echo.)>>%temp%\info.txt
for /f "tokens=2 delims= " %%a in ('net config workstation^|findstr /c:"工作站域"') do echo 工作组: %%a>>%temp%\info.txt
(echo.
echo 当前用户: %USERNAME%
echo.)>>%temp%\info.txt
for /f "delims=" %%a in ('date /t') do echo 本机日期: %%a>>%temp%\info.txt
echo.>>%temp%\info.txt
for /f "delims=" %%a in ('time /t') do echo 本机时间: %%a>>%temp%\info.txt
echo ---------------------------------------------------------->>%temp%\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">>%temp%\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 代{过}{滤}理已启用">>%temp%\info.txt
:sc_info_next
(echo.
echo ----------------------------------------------------------
echo.
echo.)>>%temp%\info.txt
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
if %bulid%==nt10 reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v AllowInsecureGuestAuth /t REG_DWORD /d 0x1 /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\MSV1_0" /v LmCompatibilityLevel /t REG_DWORD /d 0x1 /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 restrictnullsessaccess /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 service type = fileandprint mode = enable scope = subnet>nul 2>nul
set "nbt=HKLM\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces"
for /f "tokens=2 delims={" %%a in ('reg query "%nbt%"') do (reg query "%nbt%\TCPIP_{%%a" /s|findstr /i /c:"NetbiosOptions">nul && reg add "%nbt%\TCPIP_{%%a" /v NetbiosOptions /t REG_DWORD /d 0x0 /f>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 firewall set rule group=\"网络发现\" new enable=Yes>nul 2>nul
netsh advfirewall firewall set rule group=\"文件和打印机共享\" new enable=Yes>nul 2>nul
if %bulid%==nt10 powershell -NonInteractive "Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol">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
:sc_main2_etc
(echo
echo Unicode=yes
echo
echo signature="$CHICAGO$"
echo Revision=1
echo
echo sedenynetworklogonright =
echo senetworklogonright = Everyone,Administrators,Users,Power Users,Backup Operators,guest)>>%temp%\zcl.inf
secedit /configure /db %temp%\zcl.sdb /cfg %temp%\zcl.inf /log %temp%\zcl.log /quiet
del /q %temp%\zcl.*>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\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\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
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
reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v NodeType /f>nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v DhcpNodeType /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.&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 start 再次整合一次
添加启用SMB 1.0/CIFS 文件共享支持
@echo off
color 2f
mode con cols=100 lines=50
ver | findstr "6.1">nul && set bulid=nt6 && goto sc_top
ver | findstr "10.">nul && set bulid=nt10 && goto sc_top
ver | findstr "5.">nul && set bulid=nt5 && goto sc_top
ver | findstr "6.3">nul && set bulid=nt10 && goto sc_top
ver | findstr "6.2">nul && set bulid=nt10 && goto sc_top
rem 以下为可编辑区域,仅动“=”后面的参数
set 服务器主机端IP=10.10.8.88
set 服务器主机端用户名=Administrator
set 服务器主机端密码=""
rem可编辑区域结束,以下代码不要动,以免报错
rem 以下为可来宾账户编辑区域,仅动“=”后面的参数;非特殊情况,可以忽略不修改!!
set guest服务器主机端用户名=GUEST
set guest服务器主机端密码=""
rem可编辑区域结束,以下代码不要动,以免报错
setlocal enabledelayedexpansion
:sc_top
cls
del /q %temp%\info.txt>nul 2>nul
:start
cls
echo.&echo.
echo ----------------------------------------------------------------------------------------------------
echo.
echo 此程序旨在快速部署系统凭据及解决共享打印问题,以下为简单实用方法
echo.
echo 1、此程序上点击右键选择编辑,找到服务器主机端位置,修改为服务器参数
echo.
echo 2、保存并以管理员身份运行
echo.
echo 3、先运行选项7开启端口,然后根据需要创建凭证即可
echo.
echo 4、一般情况下使用默认的用户名即可,特殊情况可以选择修改并使用来宾账户信息(记得开启来宾权限)
echo.
echo 5、如果还是不行,参考打包文件中的帮助文档以及对应的解决工具。
echo ----------------------------------------------------------------------------------------------------
echo.
echo.
echo 凭证管理器
echo ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
echo. ┋ ┋
echo ┋ 〖1.查看本机信息〗 ┋
echo ┋ 〖2.查看凭据〗 ┋
echo ┋ 〖3.创建WINDOS凭据〗 ┋
echo ┋ 〖4.创建普通凭据〗 ┋
echo ┋ 〖5.删除现有凭据〗 ┋
echo ┋ 〖6.删除RAS凭据〗 ┋
echo ┋ 〖7.开启RPC端口〗 ┋
echo ┋ 〖8.添加来宾账户到WINDOS凭据〗 ┋
echo ┋ 〖9.添加来宾账户到普通凭据凭据〗 ┋
echo ┋ 〖0.一键开启来宾账户权限〗 ┋
echo ┋ 〖a.一键关闭来宾账户权限〗 ┋
echo ┋ 〖b.卸载更新补丁〗 ┋
echo ┋ 〖c.简单共享(无密码)〗 ┋
echo ┋ 〖d.密码共享〗 ┋
echo ┋ 〖e.共享和权限管理〗 ┋
echo ┋ 〖f.权限设置指南(图文)〗 ┋
echo ┋ 〖g.打印机共享指南(图文)〗 ┋
echo ┋ 〖h.更新与反馈〗 ┋
echo ┋ 〖i.打开启用或关闭windows功能〗 ┋
echo ┋ 〖j.启用SMB 1.0/CIFS 文件共享支持〗 ┋
echo. ┋ ┋
echo. ┋ ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┋
echo ┋ ┋X.视频教程 ┋y.退出程序 ┋z.码农冠名 ┋
echo. ╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝
:cho
set choice=
set /p choice= 请输入对应的选项按回车:
IF NOT "%Choice%"=="" SET Choice=%Choice:~0,1%
if /i "%choice%"=="1" goto sc_info
if /i "%choice%"=="2" goto ckpj
if /i "%choice%"=="3" goto cjypj
if /i "%choice%"=="4" goto cjptpj
if /i "%choice%"=="5" goto scxypj
if /i "%choice%"=="6" goto scraspj
if /i "%choice%"=="7" goto zjrcpdk
if /i "%choice%"=="8" goto cjypjguest
if /i "%choice%"=="9" goto cjptpjguest
if /i "%choice%"=="0" goto kqlbzh
if /i "%choice%"=="a" goto gblbzh
if /i "%choice%"=="b" goto scgxbd
if /i "%choice%"=="c" goto sc_zd
if /i "%choice%"=="d" goto sc_sd
if /i "%choice%"=="e" goto sc_gl
if /i "%choice%"=="f" goto sc_help
if /i "%choice%"=="g" goto sc_print
if /i "%choice%"=="h" goto sc_update
if /i "%choice%"=="i" goto qyhgb
if /i "%choice%"=="j" goto smb
if /i "%choice%"=="X" goto spjc
if /i "%choice%"=="y" goto end
if /i "%choice%"=="z" goto mngm
echo 选择无效,请重新输入
echo.
goto cho
:ckpj
cls
cmdkey /list
pause >nul
goto start
:cjypj
cls
cmdkey /add:%服务器主机端IP% /user:%服务器主机端用户名% /pass:%服务器主机端密码%
pause >nul
goto start
:cjptpj
cls
cmdkey /generic:%服务器主机端IP% /user:%服务器主机端用户名% /pass:%服务器主机端密码%
pause >nul
goto start
rem以下代码为来宾账户信息,便于检查故障
:cjypjguest
cls
cmdkey /add:%服务器主机端IP% /user:%guest服务器主机端用户名% /pass:%guest服务器主机端密码%
pause >nul
goto start
:cjptpjguest
cls
cmdkey /generic:%服务器主机端IP% /user:%guest服务器主机端用户名% /pass:%guest服务器主机端密码%
pause >nul
goto start
:kqlbzh
cls
net user guest /active:yes
net localgroup "Remote Desktop Users" /add GUEST
regedit /s 开通局域网共享(访问本机无需验证即可进入).reg
pause >nul
goto start
:gblbzh
cls
net user guest /active:no
pause >nul
goto start
:scxypj
cls
cmdkey /delete:%服务器主机端IP%
pause >nul
goto start
:scraspj
cls
cmdkey /delete /ras
pause >nul
goto start
:zjrcpdk
cls
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\RPC" /v RpcUseNamedPipeProtocol /t REG_DWORD /d 1 /f
pause >nul
goto start
:scgxbd
@echo off
@wusa /quiet /uninstall /kb:5006670
@wusa /quiet /uninstall /kb:5006667
@wusa /quiet /uninstall /kb:5006672
@wusa /quiet /uninstall /kb:5006669
@wusa /quiet /uninstall /kb:5006675
@echo off
@echo 卸载完成
pause >nul
goto start
:spjc
cls
start "" "https://www.douyin.com/user/self?from_tab_name=main&modal_id=7420375072235474191&showTab=post"
goto start
:SMB
echo ----------------------------------------------------------------------------------------------------
echo.
echo 1、运行选项i打开(启用或关闭windows功能)
echo.
echo 2、勾选(SMB 1.0/CIFA 文件共享支持)
echo.
echo 3、点击(确定)
echo ----------------------------------------------------------------------------------------------------
pause >nul
goto start
:mngm
echo ----------------------------------------------------------------------------------------------------
echo.
echo 1、感谢二虎电脑提供源码
echo.
echo 2、感谢开心快捷服务中心提供二开源码
echo.
echo 3、欢迎更多的码农提供更多更完整的修复共享打印源码
echo ----------------------------------------------------------------------------------------------------
pause >nul
goto start
:qyhgb
cls
start "" "OptionalFeatures"
goto start
: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.)>>%temp%\info.txt
ping www.baidu.com -n 1 >nul || echo 互联网状态: [ 离线 ]>>%temp%\info.txt && goto sc_ver_nt5
echo 互联网状态: [ 在线 ]>>%temp%\info.txt
:sc_ver_nt5
(echo ----------------------------------------------------------
echo.)>>%temp%\info.txt
for /f "skip=1 tokens=2-4 delims=, " %%a in ('wmic os get caption') do (
if exist %windir%\SysWOW64 echo 系统版本: %%a %%b %%c64位>>%temp%\info.txt & goto sc_ver_nt5_next
echo 系统版本: %%a %%b %%c32位>>%temp%\info.txt
)
:sc_ver_nt5_next
(echo.
echo 计算机名: %COMPUTERNAME%
echo.)>>%temp%\info.txt
for /f "tokens=2 delims= " %%a in ('net config workstation^|findstr /c:"工作站域"') do echo 工作组: %%a>>%temp%\info.txt & goto sc_info_nt5
:sc_info_nt5
(echo.
echo 当前用户: %USERNAME%
echo.)>>%temp%\info.txt
for /f "delims=" %%a in ('date /t') do echo 本机日期: %%a>>%temp%\info.txt
echo.>>%temp%\info.txt
for /f "delims=" %%a in ('time /t') do echo 本机时间: %%a>>%temp%\info.txt
echo ---------------------------------------------------------->>%temp%\info.txt
goto sc_info_more
:sc_nt6
(echo.
echo.)>>%temp%\info.txt
ping www.baidu.com -n 1 >nul || echo 互联网状态: [ 离线 ]>>%temp%\info.txt && goto sc_ver_nt6
echo 互联网状态: [ 在线 ]>>%temp%\info.txt
:sc_ver_nt6
(echo ----------------------------------------------------------
echo.)>>%temp%\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位>>%temp%\info.txt & goto sc_ver_nt6_next
echo 系统版本: %%a %%b %%c %%d 32位>>%temp%\info.txt
)
:sc_ver_nt6_next
(echo.
echo 计算机名: %COMPUTERNAME%
echo.)>>%temp%\info.txt
for /f "tokens=2 delims= " %%a in ('net config workstation^|findstr /c:"工作站域"') do echo 工作组: %%a>>%temp%\info.txt
(echo.
echo 当前用户: %USERNAME%
echo.)>>%temp%\info.txt
for /f "delims=" %%a in ('date /t') do echo 本机日期: %%a>>%temp%\info.txt
echo.>>%temp%\info.txt
for /f "delims=" %%a in ('time /t') do echo 本机时间: %%a>>%temp%\info.txt
echo ---------------------------------------------------------->>%temp%\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">>%temp%\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 代{过}{滤}理已启用">>%temp%\info.txt
:sc_info_next
(echo.
echo ----------------------------------------------------------
echo.
echo.)>>%temp%\info.txt
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
if %bulid%==nt10 reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v AllowInsecureGuestAuth /t REG_DWORD /d 0x1 /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\MSV1_0" /v LmCompatibilityLevel /t REG_DWORD /d 0x1 /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 restrictnullsessaccess /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 service type = fileandprint mode = enable scope = subnet>nul 2>nul
set "nbt=HKLM\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces"
for /f "tokens=2 delims={" %%a in ('reg query "%nbt%"') do (reg query "%nbt%\TCPIP_{%%a" /s|findstr /i /c:"NetbiosOptions">nul && reg add "%nbt%\TCPIP_{%%a" /v NetbiosOptions /t REG_DWORD /d 0x0 /f>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 firewall set rule group=\"网络发现\" new enable=Yes>nul 2>nul
netsh advfirewall firewall set rule group=\"文件和打印机共享\" new enable=Yes>nul 2>nul
if %bulid%==nt10 powershell -NonInteractive "Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol">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
:sc_main2_etc
(echo
echo Unicode=yes
echo
echo signature="$CHICAGO$"
echo Revision=1
echo
echo sedenynetworklogonright =
echo senetworklogonright = Everyone,Administrators,Users,Power Users,Backup Operators,guest)>>%temp%\zcl.inf
secedit /configure /db %temp%\zcl.sdb /cfg %temp%\zcl.inf /log %temp%\zcl.log /quiet
del /q %temp%\zcl.*>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\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\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
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
reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v NodeType /f>nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v DhcpNodeType /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.&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 start 先赞再看,谢谢分享 感谢楼主分享 这个脚本不错 感谢分享收藏了 一会测试下哈哈哈 收藏了,以备不时之需。 感谢分享
修改密码了,不侵权吧 sxp3468 发表于 2024-10-14 09:52
感谢分享
修改密码了,不侵权吧
{:301_973:}侵权倒是谈不上,这也是为啥我一直在寻找加密方法的原因,就是为了防止你们改密码用的{:301_972:} 有点多看不明白。直接帮搞一条bat吧。 是不是有douyin弹窗呢?
感谢分享,下载收藏。