Skip to content

Commit

Permalink
replace method f. enable smb f. passwordless share
Browse files Browse the repository at this point in the history
  • Loading branch information
LizenzFass78851 committed Jun 23, 2024
1 parent 665d7e1 commit 32bfd90
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions w11 modding/Enable SMB access to passwordless shares.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@echo off

>nul 2>&1 fsutil dirty query %systemdrive% && (goto gotAdmin) || (goto UACPrompt)
:UACPrompt
if exist "%SYSTEMROOT%\System32\Cscript.exe" (
echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~s0", "", "", "runas", 1 > "%temp%\getadmin.vbs"
cscript //nologo "%temp%\getadmin.vbs"
exit /b
) else (
powershell -Command "Start-Process -Verb RunAs -FilePath '%~s0'"
exit /b
)
:gotAdmin
if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
pushd "%CD%" && CD /D "%~dp0"
cls
TITLE Enable SMB access to passwordless shares
ECHO Ready?
echo 1 Enable
echo 2 Disable
echo 3 Exit
set /p uni= Type option in number:
if %uni% ==1 goto :enable
if %uni% ==2 goto :disable
if %uni% ==3 goto :exits

:enable
powershell -command "Set-SmbClientConfiguration -RequireSecuritySignature $false"
powershell -command "Set-SmbClientConfiguration -EnableInsecureGuestLogons $true"
goto :exits

:disable
powershell -command "Set-SmbClientConfiguration -RequireSecuritySignature $true"
powershell -command "Set-SmbClientConfiguration -EnableInsecureGuestLogons $false"
goto :exits

:exits
timeout 10
exit
Binary file not shown.

0 comments on commit 32bfd90

Please sign in to comment.