diff --git a/bat/ClearStaticIP.bat b/bat/ClearStaticIP.bat new file mode 100644 index 0000000..1464a5b --- /dev/null +++ b/bat/ClearStaticIP.bat @@ -0,0 +1,13 @@ +@echo off +::::::::::::::::::::::::::: +:±ØÐëÒª¹ÜÀíԱȨÏÞ +:¸ü¸ÄÍø¿¨Îªdhcp + + +netsh interface ip delete dns "Local Area Connection" all +netsh interface ip set address "Local Area Connection" dhcp +netsh interface ip delete dns "Local Area Connection" all +ipconfig /release +ipconfig /flushdns +netsh interface ip delete arpcache +ipconfig /renew \ No newline at end of file diff --git a/bat/EditRemotePort.bat b/bat/EditRemotePort.bat new file mode 100644 index 0000000..39aa747 --- /dev/null +++ b/bat/EditRemotePort.bat @@ -0,0 +1,30 @@ +@echo off +:::::::::::::::::::::::::::: +:±ØÐëÒª¹ÜÀíԱȨÏÞ +:Ê×ÏÈдÈëÒ»¸ö×¢²á±íÎļþ +:ÌáÐÑÓû§ÊäÈëÐèÒª¸ü¸ÄµÄ¶Ë¿ÚºÅ +:ÓÉÓÚÕâÀïÐèҪʮÁù½øÖÆÊý¾Ý£¬µ«ÊÇÓû§²»»á¼Ç¼Õâ¸ö£¬ËùÒÔÒªÓÐÒ»¸öת»»¹ý³Ì +:ת»»Íê±Ïºó¼ÌÐøдÈë×¢²á±í£¬È»ºóÔËÐиÃ×¢²á±í£¬×îºóɾ³ý +echo Windows Registry Editor Version 5.00 >t1.reg +echo. +echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] >>t1.reg +:::::::::::::::::::::::::::::::::::::Ê®½øÖÆת»»Ê®Áù½øÖÆ +setlocal enabledelayedexpansion +set hexstr=0 1 2 3 4 5 6 7 8 9 A B C D E F +set d=0 +for %%i in (%hexstr%) do (set d!d!=%%i&set/a d+=1) +set/p scanf=ÇëÊäÈëÐèÒª¸Ä±äµÄRDP¶Ë¿ÚºÅ£¬²»¿É³¬¹ý65535£º +if not defined scanf exit/b +set dec=%scanf% +call :d2h +if not defined hex set hex=0 +::echo %dec% µÄÊ®Áù½øÖÆΪ£º0x%hex% +echo "PortNumber"=dword:0%hex% >>t1.reg +regedit /s t1.reg +del /q t1.reg +:d2h +if %scanf% equ 0 exit/b +set/a tscanf=%scanf%"&"15 +set/a scanf">>="4 +set hex=!d%tscanf%!!hex! +goto :d2h \ No newline at end of file diff --git a/bat/README.md b/bat/README.md new file mode 100644 index 0000000..3f85902 --- /dev/null +++ b/bat/README.md @@ -0,0 +1,2 @@ +# Bat +存放一些windows cmd 脚本