|
本帖最后由 2010hook 于 2024-7-5 15:05 编辑
我分享一键共享批处理,实测在常规系统和PE都马上可用,手机APP推荐 FileManager+ Mod。
新建一个有密码的来宾账户,然后共享文件夹,可分配权限read/change/full,人数5够了,修正有关注册表:
- @echo off
- SetLocal EnableDelayedExpansion
- set "name=guy"
- net user %name% 123456 /add /passwordreq:yes /passwordchg:no >nul 2>nul
- net localgroup Guests %name% /add >nul 2>nul
- net localgroup Users %name% /del >nul 2>nul
- net share "Music"="%~d0\Music" /grant:%name%,read /users:5 >nul 2>nul
- net share "Video"="%~d0\Video" /grant:%name%,read /users:5 >nul 2>nul
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "ForceGuest" /t REG_DWORD /d 0 >nul
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "LimitBlankPasswordUse" /t REG_DWORD /d 1
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "RestrictAnonymousSAM" /t REG_DWORD /d 1
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "RestrictAnonymous" /t REG_DWORD /d 1 >nul
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "EveryoneIncludesAnonymous" /t REG_DWORD /d 0
- reg add "HKLM\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile" /f /v "EnableFirewall" /t REG_DWORD /d 0
- reg add "HKLM\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile" /f /v "EnableFirewall" /t REG_DWORD /d 0
- reg add "HKLM\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile" /f /v "EnableFirewall" /t REG_DWORD /d 0
- reg add "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "AutoShareServer" /t REG_DWORD /d 0 >nul
- reg add "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "AutoShareWks" /t REG_DWORD /d 0 >nul
- reg add "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "NullSessionPipes" /t REG_MULTI_SZ /d ""
- reg delete "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "SMB1" >nul 2>nul
- reg delete "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "SMB2" >nul 2>nul
- reg delete "HKLM\SYSTEM\ControlSet001\Services\NetBT\Parameters" /f /v "SMBDeviceEnabled" >nul 2>nul
- for /f %%a in ('reg query "HKLM\SYSTEM\ControlSet001\Services\NetBT\Parameters\Interfaces" /k /f "Tcpip_" 2^>nul') do (reg add "%%~a" /f /v "NetbiosOptions" /t REG_DWORD /d 2 >nul 2>nul)
- for /f "tokens=*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles" /k /f "{"') do (reg add "%%~a" /f /v "Category" /t REG_DWORD /d 1 >nul 2>nul)
- for %%a in (Browser DHCP lmhosts LanmanWorkstation LanmanServer W32Time) do (sc config "%%~a" start=auto >nul 2>nul && net start "%%~a" >nul 2>nul)
复制代码
我用System账号登陆的PE测试的,Administrator账号的更没问题。
常规系统里,专门新建来宾账号用于共享,然后管理员账号可以限制得比较严格,例如禁止远程/网络登录,总体会比较安全。
使用批处理统一设置,那么需要共享时就不用再次次费劲设置手机APP,马上可用。 |
评分
-
查看全部评分
|