I have a batch file that I want to know how it works.
Code: Select all
@echo off & setlocal
cls
:GetPCName
set /p tpc=Enter PCName to apply fix to^[default^:%computername%^]:
cls
if '%tpc%'=='' goto localch
echo Checking if PC is Online..
ping -w 1 %tpc% | find "Reply" > nul
if not errorlevel 1 GOTO online
echo PC dosent seem to be online, Check the ComputerName and try again
echo.
echo.
goto GetPCName
:online
echo detected Value
reg query "\\%tpc%\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v BufferPolicyReads
reg add "\\%tpc%\HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v BufferPolicyReads /t REG_DWORD /d 1
echo value changed to 1
goto end
:localch
echo detected Value
reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v BufferPolicyReads
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v BufferPolicyReads /t REG_DWORD /d 1
echo value changed to 1
:end
pause
Why does it req query twice and reg add twice? And what is the tpc?