批处理重置IE、批处理清理浏览器缓存、默认以管理员权限运行批处理

重置IE

@echo off
cls
echo.
echo        ================================================
echo        注意!
echo        请在开始修复前,关闭所有浏览器及其他应用程序窗口!
echo        ================================================
echo.
echo        准备好后按任意键继续……
pause >nul
echo Set objAP = CreateObject("wscript.shell")>>ResetIE.vbs
echo objAP.Run "rundll32.exe inetcpl.cpl ResetIEtoDefaults">>ResetIE.vbs
echo wscript.sleep 800>>ResetIE.vbs
echo objAP.AppActivate "Reset Internet Explorer Settings">>ResetIE.vbs
echo objAP.SendKeys "{TAB}">>ResetIE.vbs
echo objAP.SendKeys "{ }">>ResetIE.vbs
echo wscript.sleep 800>>ResetIE.vbs
echo objAP.SendKeys "{TAB}">>ResetIE.vbs
echo objAP.SendKeys "{TAB}">>ResetIE.vbs
echo objAP.SendKeys "{ }">>ResetIE.vbs
echo wscript.sleep 3000>>ResetIE.vbs
echo objAP.SendKeys "{ENTER}">>ResetIE.vbs
cscript ResetIE.vbs
echo/

echo 已重置IE浏览器!
del /q ResetIE.vbs

pause

 

参考自:https://www.cnblogs.com/kybs0/p/10914512.html

更多参考:

https://www.itsk.com/forum.php?mod=viewthread&tid=384084

http://www.awuming.com/thread-5528-2-1.html

 

清理缓存

@echo off
cls
echo.
echo        ================================================
echo        注意!
echo        请在开始修复前,关闭所有浏览器及其他应用程序窗口!
echo        ================================================
echo.
echo        准备好后按任意键继续……
pause >nul
echo        ================================================
echo        ================================================
echo        ================================================
@echo.          清理IE浏览器缓存
@echo off
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
echo.
echo.
echo.
echo           清理完毕,请按任意键退出...
pause >nul

补充说明:

附命令参数说明:

1、Temporary Internet Files  (删除Internet临时文件)  
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 

2、Cookies (删除cookie)  
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 

3、History (删除历史记录)  
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1 

4、Form Data (删除表单数据)  
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16 

5、Passwords (删除密码)  
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32 

6、Delete All  (全部删除)  
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 

7、Delete All (全部删除,包括插件的设置和文件)  
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351
 

参考自:https://blog.csdn.net/hongweigg/article/details/77693298

默认以管理员权限运行批处理

在批处理开头加上以下代码:

@ECHO OFF
setlocal EnableDelayedExpansion
 
PUSHD %~DP0 & cd /d "%~dp0"
%1 %2
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :runas","","runas",1)(window.close)&goto :eof
:runas

 

参考自:https://blog.csdn.net/lostworld_gy/article/details/85272725

更多参考:https://blog.csdn.net/Edsuns/article/details/79356821

https://blog.csdn.net/x534119219/article/details/78905282

https://blog.csdn.net/weixin_42672054/article/details/82794283

你可能感兴趣的:(批处理bat,vbs)