一些常用命令(Windows)

#清除所有事件日志.bat
start cmd /C for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"
pause
#清除垃圾临时和日志文件.bat
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
pause
#IP地址不可用自动修改为原IP.bat
@echo off 
:Begin 
ping www.baidu.com 
if errorlevel 1 goto Reboot 
if errorlevel 0 goto Continue
:Continue
goto Begin: 
:Reboot 
netsh interface ip set address "Ethernet0" static 192.168.1.114 255.255.255.0 192.168.1.1
netsh interface ip set dns "Ethernet0" static 114.114.114.114
ping -n 8 127.0.0.1 >nul 
goto Begin
 #webdav允许http文件大小限制50m变更为2G.cmd
@echo off
cls
echo 
echo change webdav(allow http,fileSizeLimit 50M to 2G)

net stop webclient
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /f /v BasicAuthLevel /t reg_dword /d 2 
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters /f /v FileSizeLimitInBytes /t reg_dword /d 4294967295
net start webclient

mshta vbscript:msgbox("webdav apply success")(window.close)
#无界面启动VMware虚拟机.bat
"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" -T ws start "D:\Program Files (x86)\Windows\Windows.vmx" nogui
#图片查看器.reg
Windows Registry Editor Version 5.00
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes.jpg]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes.jpeg]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes.gif]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes.png]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes.bmp]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes.tiff]
@="PhotoViewer.FileAssoc.Tiff"
; Change Extension's File Type
[HKEY_CURRENT_USER\Software\Classes.ico]
@="PhotoViewer.FileAssoc.Tiff"