为cmd设置密码的批处理
程序员文章站
2022-04-10 18:54:29
cmd加密是通过批处理实现的,现在我们来新建一个记事本,然后复制下面的命令并粘贴到记事本里去,并重命名为*.bat即可。 复制代码 代码如下:@echo offif exi...
cmd加密是通过批处理实现的,现在我们来新建一个记事本,然后复制下面的命令并粘贴到记事本里去,并重命名为*.bat即可。
@echo off
if exist %windir%\fly.bat attrib -a -s -r -h %windir%\fly.bat
cls
title cmd 密码设置
echo ================================================================================
echo cmd 密码设置
echo.
echo 默认密码为: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 密码错误...你没机会咯...^&ping 127.1 -n 2 ^>nul^&exit >>%windir%\fly.bat
echo echo 密码错误..你还有%%n%%机会^&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 欢迎进了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 设置完毕.............你的密码为:%paa%
echo.
gpupdate /force >nul
echo 任意键退出....
pause>nul
exit
复制代码 代码如下:
@echo off
if exist %windir%\fly.bat attrib -a -s -r -h %windir%\fly.bat
cls
title cmd 密码设置
echo ================================================================================
echo cmd 密码设置
echo.
echo 默认密码为: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 密码错误...你没机会咯...^&ping 127.1 -n 2 ^>nul^&exit >>%windir%\fly.bat
echo echo 密码错误..你还有%%n%%机会^&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 欢迎进了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 设置完毕.............你的密码为:%paa%
echo.
gpupdate /force >nul
echo 任意键退出....
pause>nul
exit
:paa
echo 你没有设置密码..现起用默认密码..........
set paa=123456
goto :eof
推荐阅读
-
MySQL 8.0.13设置日期为0000-00-00 00:00:00时出现的问题解决
-
利用NTFS分区特有的权限设置属性为U盘加上密码保护
-
vsCode怎么排序? VisualStudioCode排序设置为顺序混合的技巧
-
如何将Pycharm中调整字体大小的方式设置为"ctrl+鼠标滚轮上下滑"
-
mysql安装后初始密码的设置_MySQL
-
cmd下更改mysql的密码(root用户)_MySQL
-
自动克隆guest为administrators组的批处理
-
芒果TVapp交易密码怎么设置? 芒果TV设置交易密码的技巧
-
PHPExcel如何把该列的值设置为文本无科学计数?,
-
IDEA中设置Tab健为4个空格的方法