必威-必威-欢迎您

必威,必威官网企业自成立以来,以策略先行,经营致胜,管理为本的商,业推广理念,一步一个脚印发展成为同类企业中经营范围最广,在行业内颇具影响力的企业。

echo ----正在备份注册表 请稍后....----,+文件来更

2019-09-18 20:02 来源:未知

一、供给重启

复制代码 代码如下:

自个儿担任的部门有非常多台机器,重装完后内需苏醒原本配置,笔者曾利用过相当多方式:
1:手工业退换,那条就绝不说了
2:使用netsh dump +文件和 netsh -f +文件来更改,不过总体盘都格式化就没用.
3:使用专项使用的更换ip地址的小程序,但照旧要求手工业来内定IP

复制代码 代码如下:

cls
 @color 0A
 @mode con cols=80 lines=32
 @title ★修改私下认可3389端口★
 @echo off
 echo =====================================================
 echo ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
 echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
 echo ※                               修改3389.bat v1.0                            ※
 echo ※                                 create by jim                              ※
 echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
 echo ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
 echo 时间:%date%   %time%
 echo =======================================================
 echo 用途:通过改造注册表,修改暗中认可3389端口
echo =======================================================
 goto :3389-1
 :3389-1
 ::***********************************************************
 ::导出3389端口暗中认可注册表
reg export "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server"  c:3389.reg
 goto :3389-2
 :3389-2
 set port1=53389
reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp" /t REG_DWORD /v portnumber /d %port1% /f
 set port2=53389
reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Serverwdsrdpwdtdstcp" /t REG_DWORD /v portnumber /d %port1% /f
 if %port1%==%port2% (echo 修改成功!!!) else (echo 一遍输入不均等,请重新输入。&goto 3389-2)
 goto :QUIT
 :QUIT
netsh firewall set portopening tcp 53389 mstsc-53389 enable
net stop TermService
net start TermService
 echo ________________________________________________________
 echo.
 echo ________________________________________________________
 echo            [Press any key to quit]
 echo ________________________________________________________
 echo.
 pause >nul
 exit

@echo off
set /p pcnanme=请输入计算机的名字:
reg add HKEY_LOCAL_MACHINESYSTEMControlSet001ControlComputerNameComputerName /v ComputerName /t REG_SZ /d %pcnanme% /f
eixt

@echo off
echo 骏龙包装计算机名称、Computer描述、职业组修改批管理程序
Echo
pause
cls
:set/p id=请输入本机网段号:
:set/p ip=请输入本机IP地址:
:netsh interface ip set address name="本地连接" source=static addr=192.168.%id%.%ip% mask=255.255.255.0
set /p name=请输您的主机出厂S/N编号:
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetControlComputerNameActiveComputerName" /v ComputerName /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters" /v "NV Hostname" /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters" /v Hostname /t reg_sz /d %name% /f
SET work=骏龙
wmic computersystem where Name="%NAME%" call JoinDomainOrWorkgroup Name="%work%"
set /p describe=请输入您的Computer描述(公司规定必需是使用者姓名):
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServiceslanmanserverParameters" /v srvcomment /t reg_sz /d %describe% /f

最后,笔者想到如下办法:
1:首先落到实处:netsh interface ip 来退换IP
2:使用wmic computersystem 修改职业组
3:使用reg add 来改变机器名
4:因为修改机器名后要重启才生效,于是利用:reboot.inf 来重启
5:后来净增了新机器名和ip的布局,使用机器的系列号(联想机:wmic bios get SerialNumber)来做机器名,ip地址最终1位使用随机
因为可以通过 wmic来读取类别号,那么大家得以用来登记本机的互联网安插时,就有助于多了.
6:最后将自个儿收拾的IP地址等相应表放到了bat中,防止bat调用任何文件.
7:完成地方作用后,作者就可以将该bat文件封装到gho文件里面,恢复生机重启完后就足以活动安装,作者不用做任何操作,客户就能够使用.借使有不能缺少,你能够增加实施完后机关删除自身.

@echo off
echo ----------------------------------
echo ----正在备份注册表 请稍后....----
echo ----------------------------------
  reg export "HKEY_LOCAL_MACHINE" C:/reg_backup.reg
echo ----------------------
echo ----注册表备份达成----
echo ----------------------
  ping 127.0.0.1 -n 3 >nul
echo -----------------------------------
echo ----安全安插正在改写 请稍候...----
echo -----------------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------
echo ----正在禁用空连接----
echo ----------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlLsa /v restrictanonymous /t reg_dword /d 1 /f
echo --------------------------
echo ----禁止使用空连接装置达成----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------
echo ----正在删除私下认可分享----
echo ------------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters /v AutoShareServer /t reg_dword /d 0 /f
echo ----------------------------
echo ----删除暗中认可分享设置停止----
echo ----------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在修改TTL值请稍后...----
echo ------------------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v DefaultTTL /t reg_dword /d 53 /f
echo -------------------
echo ----TTL修改达成----
echo -------------------
  @ping 127.0.0.1 -n 3 >nul
echo -----------------------
echo ----幸免syn暴风雪攻击----
echo -----------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v SynAttackProtect /t reg_dword /d 2 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v EnablePMTUDiscovery /t reg_dword /d 0 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v NoNameReleaseOnDemand /t reg_dword /d 1 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v EnableDeadGWDetect /t reg_dword /d 0 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v KeepAliveTime /t reg_dword /d 300000 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v PerformRouterDiscovery /t reg_dword /d 0 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v EnableICMPRedirects /t reg_dword /d 0 /f
echo -------------------------------
echo ----幸免syn雪暴攻击设置甘休----
echo -------------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ------------------------------
echo ---- 系统服务修改 ----
echo ------------------------------
echo ------------------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----修改3389端口----
echo --------------------
  reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWds dpwdTdstcp" /v PortNumber /t reg_dword /d 44454 /f
  reg add "HKEY_LOCAL_MACHINESYSTEMCurrentContro1SetControlTenninal ServerWinStationsRDPTcp" /v PortNumber /t reg_dword /d 44454 /f
echo --------------------
echo ----修改PORT完毕----
echo --------------------
  @ping 127.0.0.1 -n 3 >nul
echo -------------------------------------
echo ----正在张开系统防火墙 请稍后....----
echo -------------------------------------
  sc config sharedaccess start= auto & net start sharedaccess
echo ------------------------
echo ----系统防火墙已开启----
echo ------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭分享打字与印刷服务----
echo ----------------------------
  @sc config Spooler start= disabled
  sc config LanmanServer start= disabled
  sc config LmHosts start= disabled
echo --------------------------
echo ----已关门分享打字与印刷服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭远程协理服务----
echo ----------------------------
  @sc config RDSessMgr start= disabled
echo --------------------------
echo ----已关门远程帮助服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在关闭远程注册表服务----
echo ------------------------------
  @sc config RemoteRegistry start= disabled
echo ----------------------------
echo ----已关闭远程注册表服务----
echo ----------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----关闭自动硬件播放文告----
echo ----------------------------
  sc config ShellHWDetection start= disabled
echo -----------------------
echo ----自动播放通告关闭---
echo -----------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------------------
echo ----正在关闭替换凭据下的启航进度服务----
echo ----------------------------------------
  sc config seclogon start= disabled
echo --------------------------
echo ----已关门运营进度服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------------
echo ----IEEE 802.11 适配器的自动配置----
echo ------------------------------------
  sc config WZCSVC start= disabled
echo ------------------
echo ----已关闭IEEE----
echo ------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------------
echo ----顾客端追踪服务关闭----
echo --------------------------
  sc config TrkSvr start= disabled
  sc config MSDTC start= disabled
echo ----------------------------
echo ----已关闭顾客端追踪服务----
echo ----------------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----协理焦点关闭----
echo --------------------
  sc config helpsvc start= disabled
echo --------------------------
echo ----已关闭支持中央服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------------------
echo --------------------------------
echo ---- 系统权限加固 ----
echo --------------------------------
echo --------------------------------
echo -------------------------------------------------------
echo ----C盘(系统盘) (administrators,system完全调控权限)----
echo -------------------------------------------------------
  cacls C: /t /c /g administrators:F system:F
echo -------------------------------------------
echo ----Common Files (everyone客户只读权限)----
echo -------------------------------------------
  Cacls "C:Program FilesCommon Files" /t /e /c /g everyone:R
echo -------------------------------------------------------------
echo ----IIS Temporary Compressed Files (everyone客户改动权限)----
echo -------------------------------------------------------------
  Cacls "C:WINDOWSIIS Temporary Compressed Files" /t /e /c /g everyone:C
echo --------------------------------------------
echo ----Microsoft.Net (everyone顾客只读权限)----
echo --------------------------------------------
  Cacls C:WINDOWSMicrosoft.Net /t /e /c /g everyone:R
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone顾客改换权限)----
echo ------------------------------------------------------
  Cacls "C:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files" /t /e /c /g everyone:C
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone客户更换权限)----
echo ------------------------------------------------------
  Cacls "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files" /t /e /c /g everyone:C
echo -------------------------------------------
echo ----Registration (everyone顾客读取权限)----
echo -------------------------------------------
  Cacls C:WINDOWSRegistration /t /e /c /g everyone:R
echo -----------------------------------
echo ----Temp (everyone顾客改换权限)----
echo -----------------------------------
  Cacls C:WINDOWSTemp /t /e /c /g everyone:C
echo -------------------

急需重启Computer技能见效

net config server /SRVCOMMENT:"%describe%"
pause

全副代码如下:(接待大家继续优化和整治)

 @echo off
echo ----------------------------------
echo ----正在备份注册表 请稍后....----
echo ----------------------------------
  reg export "HKEY_LOCAL_MACHINE" C:/reg_backup.reg
echo ----------------------
echo ----注册表备份完毕----
echo ----------------------
  ping 127.0.0.1 -n 3 >nul
echo -----------------------------------
echo ----安全布置正在改写 请稍候...----
echo -----------------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------
echo ----正在禁止使用空连接----
echo ----------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlLsa /v restrictanonymous /t reg_dword /d 1 /f
echo --------------------------
echo ----禁用空连接装置截至----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------
echo ----正在删除默许分享----
echo ------------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceslanmanserverparameters /v AutoShareServer /t reg_dword /d 0 /f
echo ----------------------------
echo ----删除暗中同意分享设置结束----
echo ----------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在修改TTL值请稍后...----
echo ------------------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v DefaultTTL /t reg_dword /d 53 /f
echo -------------------
echo ----TTL修改达成----
echo -------------------
  @ping 127.0.0.1 -n 3 >nul
echo -----------------------
echo ----避免syn雨涝攻击----
echo -----------------------
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v SynAttackProtect /t reg_dword /d 2 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v EnablePMTUDiscovery /t reg_dword /d 0 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v NoNameReleaseOnDemand /t reg_dword /d 1 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v EnableDeadGWDetect /t reg_dword /d 0 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v KeepAliveTime /t reg_dword /d 300000 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v PerformRouterDiscovery /t reg_dword /d 0 /f
  reg add HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters /v EnableICMPRedirects /t reg_dword /d 0 /f
echo -------------------------------
echo ----制止syn洪涝攻击设置甘休----
echo -------------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ------------------------------
echo ---- 系统服务修改 ----
echo ------------------------------
echo ------------------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----修改3389端口----
echo --------------------
  reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWds dpwdTdstcp" /v PortNumber /t reg_dword /d 44454 /f
  reg add "HKEY_LOCAL_MACHINESYSTEMCurrentContro1SetControlTenninal ServerWinStationsRDPTcp" /v PortNumber /t reg_dword /d 44454 /f
echo --------------------
echo ----修改PORT完毕----
echo --------------------
  @ping 127.0.0.1 -n 3 >nul
echo -------------------------------------
echo ----正在开启系统防火墙 请稍后....----
echo -------------------------------------
  sc config sharedaccess start= auto & net start sharedaccess
echo ------------------------
echo ----系统防火墙已拉开----
echo ------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭分享打字与印刷服务----
echo ----------------------------
  @sc config Spooler start= disabled
  sc config LanmanServer start= disabled
  sc config LmHosts start= disabled
echo --------------------------
echo ----已关门分享打字与印刷服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----正在关闭远程协助服务----
echo ----------------------------
  @sc config RDSessMgr start= disabled
echo --------------------------
echo ----已关门远程扶助服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------
echo ----正在关闭远程注册表服务----
echo ------------------------------
  @sc config RemoteRegistry start= disabled
echo ----------------------------
echo ----已关门远程注册表服务----
echo ----------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------
echo ----关闭自动硬件播放通知----
echo ----------------------------
  sc config ShellHWDetection start= disabled
echo -----------------------
echo ----自动播放布告关闭---
echo -----------------------
  @ping 127.0.0.1 -n 3 >nul
echo ----------------------------------------
echo ----正在关闭替换凭据下的启航进程服务----
echo ----------------------------------------
  sc config seclogon start= disabled
echo --------------------------
echo ----已关门运维进度服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo ------------------------------------
echo ----IEEE 802.11 适配器的机关配置----
echo ------------------------------------
  sc config WZCSVC start= disabled
echo ------------------
echo ----已关闭IEEE----
echo ------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------------
echo ----客户端跟踪服务关闭----
echo --------------------------
  sc config TrkSvr start= disabled
  sc config MSDTC start= disabled
echo ----------------------------
echo ----已关门顾客端追踪服务----
echo ----------------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------
echo ----扶助中央关闭----
echo --------------------
  sc config helpsvc start= disabled
echo --------------------------
echo ----已关门支持大旨服务----
echo --------------------------
  @ping 127.0.0.1 -n 3 >nul
echo --------------------------------
echo --------------------------------
echo ---- 系统权限加固 ----
echo --------------------------------
echo --------------------------------
echo -------------------------------------------------------
echo ----C盘(系统盘) (administrators,system完全调整权限)----
echo -------------------------------------------------------
  cacls C: /t /c /g administrators:F system:F
echo -------------------------------------------
echo ----Common Files (everyone客商只读权限)----
echo -------------------------------------------
  Cacls "C:Program FilesCommon Files" /t /e /c /g everyone:R
echo -------------------------------------------------------------
echo ----IIS Temporary Compressed Files (everyone顾客更动权限)----
echo -------------------------------------------------------------
  Cacls "C:WINDOWSIIS Temporary Compressed Files" /t /e /c /g everyone:C
echo --------------------------------------------
echo ----Microsoft.Net (everyone客商只读权限)----
echo --------------------------------------------
  Cacls C:WINDOWSMicrosoft.Net /t /e /c /g everyone:R
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone客商改变权限)----
echo ------------------------------------------------------
  Cacls "C:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files" /t /e /c /g everyone:C
echo ------------------------------------------------------
echo ----Temporary ASP.NET Files (everyone顾客更动权限)----
echo ------------------------------------------------------
  Cacls "C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files" /t /e /c /g everyone:C
echo -------------------------------------------
echo ----Registration (everyone客户读取权限)----
echo -------------------------------------------
  Cacls C:WINDOWSRegistration /t /e /c /g everyone:R
echo -----------------------------------
echo ----Temp (everyone客户改变权限)----
echo -----------------------------------
  Cacls C:WINDOWSTemp /t /e /c /g everyone:C
echo -------------------
echo ----assembly (everyone顾客读取权限)----
echo ---------------------------------------
  Cacls C:WINDOWSassembly /t /e /c /g everyone:R
echo -------------------------------------
echo ----WinSxS (everyone顾客读取权限)----
echo -------------------------------------
  Cacls C:WINDOWSWinSxS /t /e /c /g everyone:R
echo ------------------------------------
echo ----Fonts (everyone客商读取权限)----
echo ------------------------------------
  Cacls C:WINDOWSFonts /t /e /c /g everyone:R
echo ---------------------------------------
echo ----System32 (everyone客商读取权限)----
echo ---------------------------------------
  Cacls C:WINDOWSSystem32 /t /e /c /g everyone:R
echo ------------------------------------------
echo ----msdtc (networkservice客户更动权限)----
echo ------------------------------------------
  Cacls C:windowssystem32msdtc /t /e /c /g networkservice:C
echo -----------------------------------------------------
echo ----ASP Compiled Templates (everyone客商改换权限)----
echo -----------------------------------------------------
  Cacls "C:WINDOWSsystem32inetsrvASP Compiled Templates" /t /e /c /g everyone:C
echo ------------------------------------
echo ----*.exe (去除everyone客户权限)----
echo ------------------------------------
  Cacls C:WINDOWSSystem32*.exe /e /c /r everyone
echo ------------------------------------
echo ----cmd.exe (去除system客户权限)----
echo ------------------------------------
  Cacls C:WINDOWSSystem32cmd.exe /e /c /r system
echo ------------------------------------
echo ----net.exe (去除system客户权限)----
echo ------------------------------------
  Cacls C:WINDOWSSystem32 et.exe /e /c /r system
echo -------------------------------------
echo ----net1.exe (去除system客商权限)----
echo -------------------------------------
  Cacls C:WINDOWSSystem32 et1.exe /e /c /r system
echo ----------------------------------------
echo ----msdtc.exe (everyone客户读取权限)----
echo ----------------------------------------
  Cacls C:WINDOWSSystem32msdtc.exe /e /c /g everyone:R
echo ------------------------------------------
echo ----dllhost.exe (everyone客商读取权限)----
echo ------------------------------------------
  Cacls C:WINDOWSSystem32dllhost.exe /e /c /g everyone:R
echo ------------------------------------------
echo ----svchost.exe (everyone客商读取权限)----
echo ------------------------------------------
  Cacls C:WINDOWSSystem32svchost.exe /e /c /g everyone:R
echo --------------------
echo --------------------
echo ----系统加固达成----
echo --------------------
echo --------------------
  @ping 127.0.0.1 -n 3 >nul
echo -----------------------------
echo ----安全设置甘休 款待使用----
echo -----------------------------
echo ------------------
echo ----重启服务器----
echo ------------------
  @ping 127.0.0.1
  shutdown -r
  @pause

TAG标签:
版权声明:本文由必威发布于必威-操作系统,转载请注明出处:echo ----正在备份注册表 请稍后....----,+文件来更