Batch processing to realize automatic login and computer lock of fixed IP address system

Time:2020-3-31

IP address can be entered and loaded, that is to say, after entering once, it can be loaded directly without manual input.

There is no copyright, reprint and leave a name. After all, even copying is also a lot of lines, and the logic is still hard to figure out.
echo off
mode con: cols=75 lines=20
Power by — fox guy

:oder
color 1d
cls
REM menu item
echo           ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
Echo. ┋ Xixi hasn’t made anything for a long time. Make a little thing to share with you ┋
echo.          ╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝
echo        ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
Echo is purely accidental
echo        ┋                                                        ┋
echo        ┋                                                        ┋
echo        ┋    MY Space    http://hi.baidu.com/xixilikexixi        ┋
echo        ┋                                                        ┋
Echo ┋ A. automatic user login; B. automatic system lock after login
echo        ┋                                                        ┋
Echo ┋ C. system change IP setting D. exit ┋
echo        ┋                                                        ┋
echo        ┋                                                        ┋
echo        ╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝

set c=
Set / P C = select and enter:
if /I “%c%”==”a” goto auto
if /I “%c%”==”b” goto lock
if /I “%c%”==”c” goto setip
if /I “%c%”==”d” goto exit

:auto
cls
set user=
Set / P user = please enter user name:
set pass=
Set / P pass = please enter the password:

if exist auto.reg del auto.reg
echo Windows Registry Editor Version 5.00 >auto.reg
echo. >>auto.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >>auto.reg
echo “DefaultUserName”=”%user%” >>auto.reg
echo “AutoAdminLogon”=”1” >>auto.reg
echo “Defaultpassword”=”%pass%” >>auto.reg

regedit /s auto.reg
del /f /q auto.reg
Echo user automatic login setting completed
ping -n 5 127.1>nul
goto oder

:lock
if exist lock.bat del lock.bat
if exist run.vbs del run.vbs

echo @echo off >lock.bat
echo rundll32 user32.dll LockWorkStation >>lock.bat
echo exit >>lock.bat

echo DIM objShell >run.vbs
echo set objShell=wscript.createObject(“wscript.shell”) >>run.vbs
echo iReturn=objShell.Run(“lock.bat”,0, TRUE) >>run.vbs

copy lock.bat %windir%\system32\ /y
copy run.vbs %windir%\system32\ /y
Reg add HKEY? Local? Machine \ software \ Microsoft \ windows \ CurrentVersion \ run / V system lock of Xi Xi / d% windir% \ system32 \ run.vbs / F
del /f /q lock.bat
del /f /q run.vbs
After the echo system logs in, the automatic lock setting is completed
ping -n 5 127.1>nul
goto oder

:setip
:oderip
cls
REM menu item
echo           ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
Echo. ┋ Xixi hasn’t made anything for a long time. Make a little thing to share with you ┋
echo.          ╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝
echo        ╔┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╗
Echo is purely accidental
echo        ┋                                                        ┋
echo        ┋                                                        ┋
echo        ┋    MY Space    http://hi.baidu.com/xixilikexixi        ┋
echo        ┋                                                        ┋
Echo A. enter IP configuration B. load IP configuration
echo        ┋                                                        ┋
Echo ┋ C. delete all IP configurations D. return ┋
echo        ┋                                                        ┋
echo        ┋                                                        ┋
echo        ╚┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉┉╝

set c=
Set / P C = select and enter:
if /I “%c%”==”a” goto lr
if /I “%c%”==”b” goto jz
if /I “%c%”==”c” goto delset
if /I “%c%”==”d” goto oder

:jz
cls
if exist xixi.txt del xixi.txt
if exist 1.txt del 1.txt
Find “configure”% windir% \ xixi.ini > xixi.txt
FOR /F “eol=; tokens=2 delims=:” %%i in (xixi.txt) do (
echo %%i>>1.txt
)
del /f /q xixi.txt
If exist 1.txt (goto JZ1) else echo has no existing configuration! Please try to enter. & ping -n 5 127.1>nul & goto oderip

:jz1
cls
Echo your current configuration is & type 1.txt
echo.
set j=
Set / P J = do you want to load the existing IP configuration? (Y / N):
if /I “%j%”==”N” goto oderip
set jname=
Set /p jname= please enter the name of the IP configuration you want to load:

echo.
echo.
Echo the configuration to load is:% jname%
if exist N.txt del N.txt
Find% jname% connection name% windir% \ xixi.ini > n.txt
for /f “skip=2 tokens=3” %%N in (N.txt) do set name=%%N
Echo connection name:% name%

if exist I.txt del I.txt
Find% jname% IP address% windir% \ xixi.ini > i.txt
for /f “skip=2 tokens=3” %%I in (I.txt) do set ip=%%I
Echo IP address:% IP%

if exist Z.txt del Z.txt
Find% jname% subnet mask% windir% \ xixi.ini > z.txt
for /f “skip=2 tokens=3” %%Z in (Z.txt) do set mask=%%Z
Echo subnet mask:% mask%

if exist M.txt del M.txt
Find% jname% default gateway% windir% \ xixi.ini > m.txt
for /f “skip=2 tokens=3” %%M in (M.txt) do set gateway=%%M
Echo default gateway:% gateway%

if exist S.txt del S.txt
Find% jname% preferred DNS% windir% \ xixi.ini > s.txt
for /f “skip=2 tokens=3” %%S in (S.txt) do set dns1=%%S
Echo preferred DNS:% dns1%

if exist B.txt del B.txt
Find% jname% alternate DNS% windir% \ xixi.ini > b.txt
for /f “skip=2 tokens=3” %%B in (B.txt) do set dns2=%%B
Echo alternate DNS:% dns2%

del /f /q 1.txt
del /f /q N.TXT
del /f /q I.TXT
del /f /q Z.TXT
del /f /q M.TXT
del /f /q S.TXT
del /f /q B.TXT
echo.
echo.

set c=
Set / P C = loading completed! Do you want to start setting now? (Y / N):
if /I “%c%”==”n” goto oderip
goto set

:lr
cls
set pname=
Set / P pname = please enter the connection name (e.g. IP configuration at home):
set name=
Set / p name = please enter the connection name (such as local connection):
set ip=
Set / P IP = please input IP address (for example: 192.168.0.2):
set mask=
Set / P mask = please enter the subnet mask (for example: 255.255.255.0):
set gateway=
Set / P gateway = please enter the gateway (for example: 192.168.0.1):
set dns1=
Set / P dns1 = please input preferred DNS (for example: 61.128.128.68):
set dns2=
Set / P dns2 = please input standby DNS (for example: 202.202.145.5):

echo.
echo.
Do you need to save this configuration for echo? If you save it for next use, you can load this configuration directly without manual input.
set s=
set /p s=(Y/N):
if /I “%s%”==”Y” goto save

:set
cls
netsh interface ip set address name=”%name%” source=static addr=%ip% mask=%mask%
Echo IP and subnet mask set complete
netsh interface ip set address name=”%name%” gateway=%gateway% gwmetric=0
Echo gateway setup complete
netsh interface ip set dns name=”%name%” source=static addr=%dns1% register=PRIMARY
Echo dns1 setup complete
netsh interface ip add dns name=”%name%” addr=%dns2%
Echo dns2 setup complete
netsh interface ip set wins name=”%name%” source=static addr=none

goto oderip

:save
cls
Echo configuration:% pname% > >% windir% \ xixi.ini
Echo% pname% connection name:% name% > >% windir% \ xixi.ini
Echo% pname% IP address:% IP% > >% windir% \ xixi.ini
Echo% pname% subnet mask:% mask% > >% windir% \ xixi.ini
Echo% pname% default gateway:% gateway% > >% windir% \ xixi.ini
Echo% pname% preferred DNS:% dns1% > >% windir% \ xixi.ini
Echo% pname% alternate DNS:% dns2% > >% windir% \ xixi.ini
echo. >>%windir%\xixi.ini
Echo saved successfully
ping -n 3 127.1>nul
set s=
Set / P S = do you need this set of configuration settings? (Y/N):
if /I “%s%”==”Y” goto set

goto oderip

:delset
cls
del /f /q %windir%\xixi.ini
Echo delete complete
ping -n 5 127.1>nul
goto oderip
Due to the code deformation caused by the editor, it is specially packaged to download IP auto suiding jb51.rar

Recommended Today

Configure Apache to support PHP in the Apache main configuration file httpd.conf Include custom profile in

In Apache’s main configuration file / conf/ http.conf Add at the bottom Include “D:workspace_phpapache-php.conf” The file path can be any In D: workspace_ Create under PHP file apache- php.conf file Its specific content is [html] view plain copy PHP-Module setup LoadFile “D:/xampp/php/php5ts.dll” LoadModule php5_module “D:/xampp/php/php5apache2_2.dll” <FilesMatch “.php$”> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch “.phps$”> SetHandler application/x-httpd-php-source </FilesMatch> […]