Last active
February 19, 2023 14:32
-
-
Save rainyskye/0d646e9edd896f811d7326794e588bdf to your computer and use it in GitHub Desktop.
Trust Local Network in Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:sid | |
set sid="" | |
FOR /F "tokens=*" %%a in ('wmic useraccount where name^='%username%' get sid') do ( | |
set b=%%a | |
if not "!b!" == "" ( | |
set skip=false | |
(echo %%a | findstr /c:"SID" >nul) && set skip=true | |
if !skip! == false ( | |
if !sid! == "" ( | |
set sid=%%a | |
set sid=!sid: =! | |
call set "str=HKU\!sid!\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1" | |
reg add "!str!" /f /v "*" /t REG_DWORD /d 1 | |
reg add "!str!" /f /v ":Range" /t REG_SZ /d "10.*.*.*" | |
pause | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment