@echo off
if exist %windir%\fly.bat attrib -a -s -r -h %windir%\fly.bat
cls
title CMD 密碼設(shè)置
echo ================================================================================
echo CMD 密碼設(shè)置
echo.
echo 默認(rèn)密碼為:123456
echo.
echo 如需更改請在下面輸入你的密碼,不更改直接回車.........
echo.
echo ================================================================================
set paa=
set /p paa=請輸入你的新密碼:
if not defined paa call :paa
reg add "HKLM\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d %windir%\fly.bat /f >nul
echo ^@echo off >%windir%\fly.bat
echo ^cls >>%windir%\fly.bat
echo title CMD-Dos 驗證............. >>%windir%\fly.bat
echo set n=3 >>%windir%\fly.bat
echo ^:start >>%windir%\fly.bat
echo ^cls >>%windir%\fly.bat
echo echo CMD-DOS地帶 >>%windir%\fly.bat
echo echo. >>%windir%\fly.bat
echo set pa= >>%windir%\fly.bat
echo set /p pa=請輸入密碼: >>%windir%\fly.bat
echo if /i "%%pa%%"=="%paa%" goto ok >>%windir%\fly.bat
echo set /a n-=1 >>%windir%\fly.bat
echo if "%%n%%"=="0" echo 密碼錯誤...你沒機(jī)會咯...^ping 127.1 -n 2 ^>nul^exit >>%windir%\fly.bat
echo echo 密碼錯誤..你還有%%n%%機(jī)會^ping 127.1 -n 2 ^>nul >>%windir%\fly.bat
echo goto start >>%windir%\fly.bat
echo ^:ok >>%windir%\fly.bat
echo ^cls >>%windir%\fly.bat
echo title 你可以正常使用 CMD-Dos ............. >>%windir%\fly.bat
echo echo 歡迎進(jìn)了CMD-DOS地帶 >>%windir%\fly.bat
echo cd /d c: >>%windir%\fly.bat
:stt
if not exist %windir%\fly.bat goto stt
attrib +a +s +r +h %windir%\fly.bat
cls
echo.
echo.
echo 設(shè)置完畢.............你的密碼為:%paa%
echo.
gpupdate /force >nul
echo 任意鍵退出....
pause>nul
exit
:paa
echo 你沒有設(shè)置密碼..現(xiàn)起用默認(rèn)密碼..........
set paa=123456
goto :eof