zoukankan
html css js c++ java
bat 编写小记 之 MiniTools
@echo off REM 修改CMD背景字体颜色 color 2f REM 多选菜单设置 echo Choose the steps you need: echo [1]New OS need all steps. echo [2]Activate OS echo [3]Set UAC to "Nerver notify" echo [4]Set Time Zone echo [5]Set WUServer echo [6]Set Gateway MAC address echo [0]Exit set slection= set/p slection=Input your choose: if %slection% equ 1 goto a if %slection% equ 2 goto a if %slection% equ 3 goto b if %slection% equ 4 goto c if %slection% equ 5 goto d if %slection% equ 6 goto e if %slection% equ 0 goto end echo Invalid Number goto start :a echo Set KMS Server... #KMS注册命令 slmgr.vbs -skms 172.16.45.234 echo After set KMS Server successfully, please press any key to continue... pause echo Get key from KMS Server..." Slmgr.vbs -ato echo After activate OS successfully, please press any key to continue... pause if %slection% equ 1 goto b if %slection% equ 2 goto back :b REM 判断系统是否XP ver|findstr /i "xp" >nul if %errorlevel% EQU 0 (echo it's XP OS!) if %errorlevel% EQU 0 ( if %slection% equ 1 ( goto c )else ( goto back) ) echo Set UAC... REM 修改注册表 reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system /v EnableLUA /t REG_DWORD /d 00000000 /f if %slection% equ 1 goto c echo Set UAC successfully goto back :c echo Set the Time Zone... REM 设置系统时区 tzutil /s "China Standard Time" echo China Time Zone OK if %slection% equ 1 goto d echo Set Time Zone successfully goto back :d echo Set WSUServer... reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v WUServer /t REG_SZ /d http://172.16.104.221 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v WUStatusServe /t REG_SZ /d http://172.16.104.221 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v ElevateNonAdmins /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetGroupEnabled /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate /v TargetGroup /t REG_SZ /d "" /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoUpdate /t REG_DWORD /d 00000000 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v AUOptions /t REG_DWORD /d 00000004 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v ScheduledInstallDay /t REG_DWORD /d 00000000 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v ScheduledInstallTime /t REG_SZ /d 0000000a /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v UseWUServer /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v AutoInstallMinorUpdates /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v RebootRelaunchTimeoutEnabled /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v RebootRelaunchTimeout /t REG_SZ /d 0000000a /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v RescheduleWaitTime /t REG_DWORD /d 00000005 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v RescheduleWaitTimeEnabled /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAUShutdownOption /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAUAsDefaultShutdownOption /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v DetectionFrequencyEnabled /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v DetectionFrequency /t REG_DWORD /d 00000022 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoRebootWithLoggedOnUser /t REG_DWORD /d 00000000 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v RebootWarningTimeout /t REG_DWORD /d 00000010 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v RebootWarningTimeoutEnabled /t REG_DWORD /d 00000001 /f reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v "WSUS Update" /t REG_SZ /d "wuauclt.exe /detectnow" /f if %slection% equ 1 goto e echo Set WUSU successfully goto back :e echo Set Gateway MAC address ver|findstr /i "xp" >nul if %errorlevel% EQU 0 ( goto exp ) REM 获得IDX for /f "delims=" %%i in ('netsh i i show in') do (echo %%i|findstr "Local Area Connection">nul&&set s=%%i) for /f "tokens=1 delims= " %%i in ("%s%") do (set idx=%%i) REM 输入IP,判断网段 if exist C:\temp.txt del C:\temp.txt set z= set/p z=Input this system IP: echo %z%>C:\temp.txt for /f "delims=. tokens=3" %%y in (C:\temp.txt) do set x=%%y del C:\temp.txt if %x% equ 80 ( netsh -c "i i" add neighbors %idx% "172.16.83.254" "00-23-89-17-a6-b6" > C:\temp.txt goto idx ) if %x% equ 130 ( netsh -c "i i" add neighbors %idx% "172.16.131.254" "00-23-89-17-a6-b6" > C:\temp.txt goto idx ) if %x% equ 131 ( netsh -c "i i" add neighbors %idx% "172.16.131.254" "00-23-89-17-a6-b6" > C:\temp.txt goto idx ) echo Only Supply 80,130,131 subnetwork if %slection% equ 1 echo The OS is Ready! goto back :idx find "incorrect" "C:\temp.txt" && goto idxa del C:\temp.txt echo The Gateway MAC address OK! if %slection% equ 1 echo The OS is Ready! goto back :idxa echo The Idx cannot get auto netsh i i show in set n= set/p n=Input this system idx(You can get it above): if %x% equ 80 ( netsh -c "i i" add neighbors %n% "172.16.83.254" "00-23-89-17-a6-b6" > C:\temp.txt goto idx ) if %x% equ 130 ( netsh -c "i i" add neighbors %n% "172.16.131.254" "00-23-89-17-a6-b6" > C:\temp.txt goto idx ) if %x% equ 131 ( netsh -c "i i" add neighbors %n% "172.16.131.254" "00-23-89-17-a6-b6" > C:\temp.txt goto idx ) :exp echo This is XP OS if exist C:\temp.txt del C:\temp.txt set z= set/p z=Input this system IP: echo %z%>C:\temp.txt for /f "delims=. tokens=3" %%y in (C:\temp.txt) do set x=%%y del C:\temp.txt if %x% equ 80 ( arp -s "172.16.83.254" "00-23-89-17-a6-b6" echo The Gateway MAC address OK! goto back ) if %x% equ 130 ( arp -s "172.16.131.254" "00-23-89-17-a6-b6" echo The Gateway MAC address OK! goto back ) if %x% equ 131 ( arp -s "172.16.131.254" "00-23-89-17-a6-b6" echo The Gateway MAC address OK! goto back ) echo Only Supply 80,130,131 subnetwork if %slection% equ 1 echo The OS is Ready! goto back :back echo Choose the steps you need: echo [1]Back to choose other steps. echo [0]Exit CHOICE /C 10 /N /M "Input your choose:" if %errorlevel% equ 2 goto end if %errorlevel% equ 1 goto start :start echo Choose the steps you need: echo [1]New OS need all steps. echo [2]Activate OS echo [3]Set UAC to "Nerver notify" echo [4]Set Time Zone echo [5]Set WUServer echo [6]Set Gateway MAC address echo [0]Exit set slection= set/p slection=Input your choose: if %slection% equ 1 goto a if %slection% equ 2 goto a if %slection% equ 3 goto b if %slection% equ 4 goto c if %slection% equ 5 goto d if %slection% equ 6 goto e if %slection% equ 0 goto end echo Invalid Number goto start :end echo You may restart the computer to apply some changes CHOICE /C 10 /N /M "Restart now input 0, Restart later input 1:" if %errorlevel% equ 2 shutdown -r -t 0 echo Good Luck! pause>nul
查看全文
相关阅读:
Javascript 创建对象的三种方法及比较【转载+整理】
Firebug Console Panel 控制台详解【转载+整理】
解剖 CPU(另)
解剖 CPU
关于 URL 编码及 JavaScript 编码函数【转载+整理】
基于用户投票的 6 个排名算法【转载+整理】
奥巴马筹款网站的制作过程【转载+整理】
CentOS 7.0关闭默认firewall防火墙启用iptables防火墙
mybatis-generator 代码自动生成工具
Linux中启动和停止jar包的运行
原文地址:https://www.cnblogs.com/Liangw/p/2559930.html
最新文章
2012年5月阿里巴巴集团”去 IOE”运动的思考与总结【转载+整理】
NAS 网络附属存储
从 bootup.js 学习加载脚本等资源
JavaScript 继承——三种继承方法及其优劣
JavaScript 作用域和闭包——另一个角度:扩展你对作用域和闭包的认识【翻译+整理】
JavaScript:如何获得 Private、Privileged、Public 和 Static 成员(属性和方法)【翻译+整理】
JavaScript 上下文环境和作用域,以及 call、apply 和 bind【转载+翻译+整理】
JavaScript 为什么不要使用 eval
JavaScript 命名空间
JavaScript 从闭包可以做什么开始,将有助于理解闭包
热门文章
Javascript 闭包(Closures)
ckeditor 4.2.1_演示 ckeditor 上传&插入图片
ext js/Ext.Net_演示 htmleditor 上传&插入图片
美国 2006 年机器学习和知识发现年会数据挖掘使用率较高算法排名
Oracle ODP.NET vs Microsoft MSDP
IOCCC(The International Obfuscated C Code Contest)
Web UI 技术发展历程
Ajax:HyperText/URI, HTML, Javascript, frame, frameset, DHTML/DOM, iframe, XMLHttp, XMLHttpRequest
Javascript 的模块化编程及加载模块【转载+整理】
异步 JS: Callbacks, Listeners, Control Flow Libs 和 Promises【转载+翻译+整理】
Copyright © 2011-2022 走看看