Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use batch to set a password for cmd

Shulou Source: shulou.com Published: 2022-06-03 08:14:56 10月02日 Update

This article mainly introduces how to use batch processing to set the password for cmd, the article introduces in great detail, has a certain reference value, interested friends must read it!

CMD encryption is achieved through batch processing. Now let's create a new notepad, then copy the following command and paste it into notepad and rename it to * .bat.

The code is as follows:

@ echo offif exist% windir%\ fly.bat attrib-a-s-r-h% windir%\ fly.batclstitle CMD password setting echo = echo CMD password setting echo.echo default password is: 123456echo.echo if you need to change, please enter your password below Enter your new password: if not defined paa call: paareg add "HKLM\ SOFTWARE\ Microsoft\ Command Processor" / v AutoRun / t REG_SZ / d% windir%\ fly.bat / f > nulecho ^ @ echo off >% windir%\ fly.batecho ^ cls > >% windir%\ fly.batecho title CMD-Dos verification. >% windir%\ fly.batecho set zone 3 > >% windir%\ fly.batecho ^: start > >% windir%\ fly.batecho ^ cls > >% windir%\ fly.batecho echo CMD-DOS zone > >% windir%\ fly.batecho echo. > >% windir%\ fly.batecho set pa= > >% windir%\ fly.batecho set / p pa= Please enter the password: > >% windir%\ fly.batecho if / I "% pa%%" = = "% paa%" goto ok > >% windir%\ fly.batecho set / an echo error 1 > >% windir%\ fly.batecho if "% n%" = "0" echo password error. You don't have a chance. ^ & ping 127.1-n 2 ^ > Null ^ & exit > >% windir%\ fly.batecho echo password error.. You still have% n%% chance ^ & ping 127.1-n 2 ^ > nul > >% windir%\ fly.batecho goto start > >% windir%\ fly.batecho ^: ok > >% windir%\ fly.batecho ^ cls > >% windir%\ fly.batecho title you can use CMD-Dos normally. > >% windir%\ fly.batecho echo Welcome to CMD-DOS Zone > >% windir%\ fly.batecho cd / d c: > >% windir%\ fly.bat:sttif not exist% windir%\ fly.bat goto sttattrib + a + s + r + h% windir%\ fly.batclsecho.echo.echo is set. Your password is:% paa%echo.gpupdate / force > nulecho any key to exit. Pause > nulexit:paaecho you did not set a password.. Now use the default password. Set paa=123456goto: eof above is all the content of the article "how to use batch processing to set a password for cmd". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Password input content zone opportunity article notepad error code value interest command buddy more knowledge industry information information channel face-to-face Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Docker vpn OPPO Reno Shulou Technology