When Windows is used to connect to the Samba service, the user name and password are entered, and the user name and password are not required after login. You can run the following script if you want to log back in.

Before running this command, replace 192.168.1.202 with a real IP address.

@echo off :: BatchGotAdmin :------------------------------------- REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) pushd "%CD%" CD /D "%~dp0" :-------------------------------------- @echo off echo clear last The data, both please wait... Net use net use \192.168.1.202\IPC$/DELETE :: Purge klist ::m Net use net use \192.168.1.202\IPC$/DELETE :: Purge Klist ::m Cmdkey /delete:192.168.1.202 echo clear login data finished @echo off net stop LanmanWorkstation net Start LanmanWorkstation start/Max "" "\\192.168.1.202"Copy the code