个人实用bat文件

在去各个学校机房,经常使用的bat文件。

关闭防火墙.bat 

NetSh Advfirewall set allprofiles state off
pause

关闭休眠状态.bat

POWERCFG -Change -monitor-timeout-ac 0
POWERCFG -Change -standby-timeout-ac 0
pause;

刷新图标缓存.bat

rem 关闭Windows外壳程序explorer
taskkill /f /im explorer.exe
rem 清理系统图标缓存数据库
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
del /f "%userprofile%\AppData\Local\IconCache.db"
attrib /s /d -h -s -r "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_32.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_96.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_102.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_256.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_1024.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_idx.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_sr.db"
rem 清理 系统托盘记忆的图标
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream
rem 重启Windows外壳程序explorer
start explorer

 学校的机房一般都会安装有还原软件,时间一长/过了一寒暑假再开机,他电脑右下角就会出现留空现象,导致有些软件都没启动。此时就需要用到这个 “刷新图标缓存.bat”

为此,在计划任务设置,任何用户登录后,后30秒,运行此bat文件。

::延迟任务时间30秒
::任何用户登录时 执行    ONSTART, ONLOGON, ONIDLE, ONEVENT

schtasks /create /tn shuaxin /tr "C:\Users\Administrator\Desktop\tubiao.bat" /sc ONLOGON /DELAY 0000:30

创建站点.bat

@set "sitePath=%~dp0"
 
@echo GzyExam
@C:\Windows\System32\inetsrv\appcmd.exe add apppool /name:"GzyExam" /managedRuntimeVersion:"v4.0"
@C:\Windows\System32\inetsrv\appcmd.exe add site /name:"GzyExam" /bindings:http/*:80: /applicationDefaults.applicationPool:"GzyExam" /physicalPath:%sitePath%
 
exit

卸载IIS.bat  

@echo off
color 0a
echo 正在卸载IIS功能,这可能需要几分钟时间...
start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel 
echo IIS已卸载成功!
pause

exit

安装IIS.bat

@echo off 
 echo 正在添加IIS8.0 功能,依据不同的网络速率,全程大约需要5分钟时间... 
 start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-ASPNET45;IIS-NetFxExtensibility45;NetFx4Extended-ASPNET45;IIS-NetFxExtensibility;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
 echo 祝贺您 IIS 8.0 已添加成功! 
exit

恢复任务管理器.bat

@reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "DisableTaskMgr" /t REG_DWORD /d "0" /f>nul

安装sqlpress.bat

@echo off
set "path=%~dp0ConfigurationFile.ini"
cd %~dp0
SQLEXPR_x64_CHS.EXE /ConfigurationFile=%path%  /AGTSVCPASSWORD="xxx" /ASSVCPASSWORD="xxx" /ISSVCPASSWORD="xxx" /RSSVCPASSWORD="xxx" /SAPWD="xxx" /Q


静默安装模板.bat

Teacher_2.7.13273.exe /verysilent /noscreendriver

IP绑定.bat


@rem 运行 : 右键菜单-〉以管理员身份运行
@echo off
title --IP自动设置 -- 
MODE con: COLS=80 lines=30
color 0a

:menu
cls

echo ----------------------------------
echo       请选择,输入数字按回车
echo ----------------------------------
echo.
echo       设置直连网络IP 请按 1
echo       设置为自动获取 请按 2
echo       设置为代理IP   请按 3
echo       设置IE代理     请按 4
echo       清除IE代理     请按 5
echo       查看当前IP     请按 6
echo       退出           请按 7
echo.
set /p choice=      您的选择:

echo.

if "%choice%"=="1" goto ip1
if "%choice%"=="2" goto ip2
if "%choice%"=="3" goto ip3
if "%choice%"=="4" goto ie4
if "%choice%"=="5" goto ie5
if "%choice%"=="6" goto ip6
if "%choice%"=="7" goto end

goto menu

:ip1

echo 请输入最后一位IP号:

set /p setip= 
echo.
echo 直连IP绑定开始,请稍后....

@set INTERFACE=本地连接

@set IP=192.168.1.%setip%
@set MASK=255.255.255.0
@set GATEWAY=192.168.1.1
@set DNS=202.103.224.68


netsh interface ip set address "%INTERFACE%" static %IP% %MASK% %GATEWAY% 0
netsh interface ip set dns "%INTERFACE%" static %DNS% PRIMARY


@echo 设置完毕,自动退出!
exit

:ip2
echo IP自动设置开始....
echo.
echo 自动获取IP地址....
@rem  win7: name="本地连接"   win8: name = "以太网"

netsh interface ip set address name = "本地连接" source = dhcp
echo 自动获取DNS服务器....
netsh interface ip set dns name = "本地连接" source = dhcp 
@echo 设置完毕,自动退出!
exit

:ip3

echo 请输入最后一位IP号:

set /p setip= 
echo.
echo 代理IP绑定开始,请稍后....

@set INTERFACE=本地连接

@set IP=192.168.1.%setip%
@set MASK=255.255.255.0
@set GATEWAY=192.168.1.111
@set DNS=222.52.118.216


netsh interface ip set address "%INTERFACE%" static %IP% %MASK% %GATEWAY% 0
netsh interface ip set dns "%INTERFACE%" static %DNS% PRIMARY


@echo 设置完毕,自动退出!
exit

:ie4
@echo off 
echo 开始设置IE代理上网 
@rem 172.88.28.10:80 修改为自己要设置的代理以及端口
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f 
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "172.88.28.10:80" /f  
@echo 设置代理完毕,自动退出!
exit

:ie5
@echo off 
echo 开始清除IE代理设置 
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f 
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f 
echo IE代理清除完毕,自动退出! 
exit


:ip6
@echo off
cls
color 0A
ipconfig /all
pause >nul
goto menu

批量访问某网站

@echo off

SETLOCAL
set  /a var=10
:start

set /a var+=1

start chrome.exe "http://192.168.xxx.xxx:8008/CertificateDownLoad.html?QID=489&UserName=%E6%9D%8&TRID=1065"

::注释 url也可带参数变量,比如
::start chrome.exe https://xx.xx.com/jw/flow_test.jsp?StepID=%var%"&RunMode=2"

if %var% leq  30 GOTO start

EXIT

 

批量ping 和批量telnet

ping的: 192.168.1.8008~8021
for /L %D in (8008,1,8021) do ping 192.168.1.%D



telnet的: (端口8008~8021)
for /L %D in (8008,1,8021) do telnet 113.xx.xxx.xxx %D

 

常用批处理 bat 程序├─BAT优化│ -禁止修改、写入SYSTEM32目录.BAT│ -让XP不用图片查看器看图(略缩图).BAT│ DEL.JPG.SCR.BAT│ DELTEMP.BAT│ 关闭系统信使.BAT│ 减少非法关机等待扫描时间.BAT│ 删除系统备份文件.BAT│ 卸载INTEL集成显卡如同鸡胁的显面增强.BAT│ 卸载XP内置ZIP.BAT│ 恢复使用XP注册表.BAT│ 注册所有DLL.BAT│ 清除输入法外的所有RUN运行项.BAT│ 禁止修改、写入SYSTEM32目录.BAT│ 禁用危险的默认共享.BAT│ 让XP不用图片查看器看图(略缩图).BAT│ ├─其它类│ 2000XP停止打印.bat│ dir.bat│ sxs.exe 的查杀.bat│ sz.reg转换成reg.bat.bat│ 全盘删除所有文件夹下的_desktop.ini.bat│ 删除大小和类型一样的文件.bat│ 删除所有分区的默认共享.bat│ 将cwindows.复制到当前目录并显示进度.bat│ 打开快捷方式指向的目录.bat批处理读注册表的Run下面的值.bat│ 按扩展名分类.bat│ 显示c盘~z盘.bat│ 枚举当前目录及子目录大小.bat│ 枚举显示.bat│ 查找最新的文件.bat│ 每个目录占用的空间.bat│ 篮球飞人火爆版.cmd│ 结束进程.bat│ 解锁注册表.BAT│ 输出倒文.bat│ 锁注册表.BAT│ ├─系统类│ C盘转换为NTFS格式.cmd│ dos下重启.bat│ guest.bat│ win2000关机命令.bat│ WIN2003 IIS最小权限分配.bat│ winxp修改计算机名.bat│ xp下确定最后的盘符.bat│ 不显示扩展名.bat│ 不显示隐藏文件.bat│ 使用WMI别名获取CPU信息.bat│ 关闭IDE通道检测.bat│ 列举进程.bat│ 判断光驱是否可用.bat│ 判断光驱里有无光盘.bat│ 判断分区格式.bat│ 刷新策略.bat│ 取得硬盘数.bat│ 右键添加bat.bat│ 右键添加打开MS-DOS.bat│ 弹出光驱.bat│ 改变我的文档路径.bat│ 显示扩展名.bat│ 显示用户名.bat│ 显示隐藏文件.bat│ 更改电源管理方式.bat│ 更改盘符.bat│ 更改系统启动菜单的时间.bat│ 查看工作组.bat│ 查看物理内存.bat│ 查看用户是否存在.bat│ 查看电脑硬件信息.bat│ 查看驱动器.bat│ 禁止保留文档记录.bat│ 给每个盘添加卷标.cmd│ 被锁定帐户.bat│ 重命名administrator账号.bat│ └─网络类 ARP本机绑定.bat XP服务优化批处理.bat 中文显示ping结果.bat 断开网络联结.bat 显示网络配置.bat 显示自己的IP.bat 查看网关的MAC地址.bat 查看进程使用的端口.bat 检查网络信息.bat 百度关键字搜索.bat 绑定网关的批处理及预留维护提到.bat 自动改回主页.bat 自定义配置网络ip、网关、dns.bat 网络信息.txt
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值