File tree 3 files changed +45
-0
lines changed
3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ :: :::::::::::::::::::::::::
3
+ :必须要管理员权限
4
+ :更改网卡为dhcp
5
+
6
+
7
+ netsh interface ip delete dns " Local Area Connection" all
8
+ netsh interface ip set address " Local Area Connection" dhcp
9
+ netsh interface ip delete dns " Local Area Connection" all
10
+ ipconfig /release
11
+ ipconfig /flushdns
12
+ netsh interface ip delete arpcache
13
+ ipconfig /renew
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ :: ::::::::::::::::::::::::::
3
+ :必须要管理员权限
4
+ :首先写入一个注册表文件
5
+ :提醒用户输入需要更改的端口号
6
+ :由于这里需要十六进制数据,但是用户不会记录这个,所以要有一个转换过程
7
+ :转换完毕后继续写入注册表,然后运行该注册表,最后删除
8
+ echo Windows Registry Editor Version 5.00 > t1.reg
9
+ echo .
10
+ echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] >> t1.reg
11
+ :: :::::::::::::::::::::::::::::::::::十进制转换十六进制
12
+ setlocal enabledelayedexpansion
13
+ set hexstr = 0 1 2 3 4 5 6 7 8 9 A B C D E F
14
+ set d = 0
15
+ for %%i in (%hexstr% ) do (set d!d! =%%i & set/a d+=1)
16
+ set/p scanf=请输入需要改变的RDP端口号,不可超过65535:
17
+ if not defined scanf exit/b
18
+ set dec = %scanf%
19
+ call :d2h
20
+ if not defined hex set hex = 0
21
+ :: echo %dec% 的十六进制为:0x%hex%
22
+ echo " PortNumber" =dword:0%hex% >> t1.reg
23
+ regedit /s t1.reg
24
+ del /q t1.reg
25
+ :d2h
26
+ if %scanf% equ 0 exit/b
27
+ set/a tscanf=%scanf% " &" 15
28
+ set/a scanf" >>=" 4
29
+ set hex = !d%tscanf%!!hex!
30
+ goto :d2h
Original file line number Diff line number Diff line change
1
+ # Bat
2
+ 存放一些windows cmd 脚本
You can’t perform that action at this time.
0 commit comments