Batch Processing enables the system to lock the computer after automatic logon with a fixed IP Address

Source: Internet
Author: User
Tags dns2

You can input and load IP addresses. That is to say, once entered, you can directly load IP addresses later without manual input.

There is no copyright. Reprinted and reserved names. After all, even copying is still a lot of lines, and the logic is hard to figure out.
Echo off
Mode con: cols = 75 lines = 20
Title Westbrook mini program Power By --- Fox-Guy

: Oder
Color 1d
Cls
Rem menu item
Echo was too busy when there were too many attempts to handle these issues.
Echo. ┋ Xixi hasn't done anything for a long time. Let's share it with everyone.
Echo. Too many attempts have been made to handle these problems.
Echo was too busy when there were too many attempts to handle too many problems.
Echo success is purely accidental
Echo too many
Echo too many
Echo done MY Space http://hi.baidu.com/xixilikexixi done
Echo too many
Echo locked a. the user automatically logs on B. The system automatically locks the locked
Echo too many
Echo reset c. System Change ipsettings d. Exit quit
Echo too many
Echo too many
Echo was too busy when there were too many attempts to handle too many problems.

Set c =
Set/p c = select and press 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 = enter the user Name:
Set pass =
Set/p pass = 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's Automatic Login settings are complete ......
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 West system lock/d % windir % \ system32 \ run. vbs/f
Del/f/q lock. bat
Del/f/q run. vbs
The echo system automatically locks the settings after logging on ......
Ping-n 5 127.1> nul
Goto oder

: Setip
: Oderip
Cls
Rem menu item
Echo was too busy when there were too many attempts to handle these issues.
Echo. ┋ Xixi hasn't done anything for a long time. Let's share it with everyone.
Echo. Too many attempts have been made to handle these problems.
Echo was too busy when there were too many attempts to handle too many problems.
Echo success is purely accidental
Echo too many
Echo too many
Echo done MY Space http://hi.baidu.com/xixilikexixi done
Echo too many
Echo route a. Enter IP configuration B. Load IP configuration
Echo too many
Echo c. Delete All IP configurations. d. Return success.
Echo too many
Echo too many
Echo was too busy when there were too many attempts to handle too many problems.

Set c =
Set/p c = select and press 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 is not configured now! Please try to input. & Amp; ping-n 5 127.1 & gt; nul & goto

: Jz1
Cls
Echo: & 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 = enter the name of the IP configuration you want to load:

Echo.
Echo.
The echo configuration to be loaded 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 backup 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 complete! Do you want to set it now? (Y/N ):
If/I "% c %" = "n" goto oderip
Goto set

: Lr
Cls
Set pname =
Set/p pname = enter the connection name (for example, IP Address Configuration at home ):
Set name =
Set/p name = enter the connection name (for example, local connection ):
Set ip =
Set/p ip = enter an ip address (for example, 192.168.0.2 ):
Set mask =
Set/p mask = enter the subnet mask (for example, 255.255.255.0 ):
Set gateway =
Set/p gateway = enter the gateway (for example, 192.168.0.1 ):
Set dns1 =
Set/p dns1 = enter the preferred DNS (for example, 61.128.128.68 ):
Set dns2 =
Set/p dns2 = enter the backup DNS (for example, 202.202.145.5 ):

Echo.
Echo.
Does echo need to save this configuration? If you save the configuration for the next time, you can directly load the configuration 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 address and subnet mask are set ........
Netsh interface ip set address name = "% name %" gateway = % gateway % gwmetric = 0
Echo gateway is set ........
Netsh interface ip set dns name = "% name %" source = static addr = % dns1 % register = PRIMARY
Echo DNS1 settings completed ........
Netsh interface ip add dns name = "% name %" addr = % dns2 %
Echo DNS2 is set ........
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 % backup DNS: % dns2 %> % windir % \ xixi. ini
Echo.> % windir % \ xixi. ini
Echo stored ......
Ping-n 3 127.1> nul
Set s =
Set/p s = do I need to use this configuration? (Y/N ):
If/I "% s %" = "Y" goto set

Goto oderip

: Delset
Cls
Del/f/q % windir % \ xixi. ini
Echo deleted ......
Ping-n 5 127.1> nul
Goto oderip
Due to code deformation caused by the editor, pack and download ip_auto_suoding_jb51.rar.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.