常用windows注册表项备忘

  1. outlook账户配置导出
    导出Profiles项,重置账户后再重新执行reg文件导入
    HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles

  2. outlook邮件中的网页链接无法打开
    代码拷贝入reg文件执行

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareClasses.htm]
@="htmlfile"
[HKEY_CURRENT_USERSoftwareClasses.html]
@="htmlfile"
[HKEY_CURRENT_USERSoftwareClasses.shtml]
@="htmlfile"
[HKEY_CURRENT_USERSoftwareClasses.xhtml]
@="htmlfile"
[HKEY_CURRENT_USERSoftwareClasses.xhtm]
@="htmlfile"

[HKEY_LOCAL_MACHINESOFTWAREClassesIE.HTTPshellopencommand]
@=""C:\Program Files\Internet Explorer\iexplore.exe" %1"
[HKEY_LOCAL_MACHINESOFTWAREClasseshttpshellopencommand]
@=""C:\Program Files\Internet Explorer\iexplore.exe" %1"
[HKEY_LOCAL_MACHINESOFTWAREClasseshtmlfileshellopennewcommand]
@=""C:\Program Files\Internet Explorer\iexplore.exe" %1"
[HKEY_LOCAL_MACHINESOFTWAREClasseshtmlfileshellopencommand]
@=""C:\Program Files\Internet Explorer\iexplore.exe" %1"
  1. 批处理脚本关闭flash广告
    代码拷贝入bat文件执行
@echo off
taskkill /f /t /im FlashHelperService.exe
ping 127.0.0.1
del /f /s /q C:WindowsSysWOW64MacromedFlashFlashHelperService.exe
Reg delete "HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet
ExplorerMAINFeatureControlFEATURE_BROWSER_EMULATION" /v "FlashHelperService" /f
Reg delete "HKEY_LOCAL_MACHINESYSTEMControlSet001servicesFlash Helper Service" /f
Reg delete "HKEY_LOCAL_MACHINESYSTEMControlSet002servicesFlash Helper Service" /f
pause
  1. 批处理脚本清除系统垃圾
    代码拷贝入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
del /f /s /q %systemdrive%
ecycled*.*
del /f /s /q %windir%*.bak
del /f /s /q %windir%prefetch*.*
rd /s /q %windir%	emp & md %windir%	emp
del /f /q %userprofile%cookies*.*
del /f /q %userprofile%
ecent*.*
del /f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"
del /f /s /q "%userprofile%Local SettingsTemp*.*"
del /f /s /q "%userprofile%
ecent*.*"
  1. 批处理脚本重置任务栏图标
    代码拷贝入bat文件执行
@echo off
reg delete "HKEY_CURRENT_USERSoftwareClassesLocal SettingsSoftwareMicrosoftWindowsCurrentVersionTrayNotify" /f /v "IconStreams"
reg delete "HKEY_CURRENT_USERSoftwareClassesLocal SettingsSoftwareMicrosoftWindowsCurrentVersionTrayNotify" /f /v "PastIconsStream"

taskkill /IM explorer.exe /F

timeout 2

start explorer.exe
  1. 批处理脚本批量改名
    代码拷贝入bat文件,放在需批量改名文件的同目录下执行
@echo off&SetLocal ENABLEDELAYEDEXPANSION
for %%i in (*) do (
set "name=%%i"
set "name=!name:原字段=更改后字段!"
ren "%%i" "!name!"
)
pause
  1. 批处理删除指定名称的文件夹(以“results”为例)
    代码拷贝入bat文件,放入需执行删除文件夹的顶层文件夹中执行,会向下遍历
@echo off
for /f "delims=" %%i in ('dir /ad /b /s "results"') do (
   rd /s /q "%%i"
)
pause
  1. 批处理命令中调用vbs弹出消息提示框
    代码拷贝入bat文件执行
    mshta vbscript:msgbox("起来上厕所了兄弟!",64,"batch script")(window.close)

  2. 批处理获取安装程序列表
    代码拷贝入bat文件执行

@echo off
setlocal ENABLEDELAYEDEXPANSION
pushd %~dp0

::-code-::

set RF="%~dpn0.txt"
cd.>%RF%
::64位系统的32位子系统
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
  set RKey=HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall
  echo [32 bit SoftWares]>>%RF%
  call :GetIt
  echo.>>%RF%
)
::主系统
set RKey=HKEY_LOCAL_MACHINEsoftwaremicrosoftwindowscurrentversionuninstall
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
  echo [64 bit SoftWares]>>%RF%
) else (
  echo [32 bit SoftWares]>>%RF%
)
call :GetIt

set RKey=
set RF=
::-code-::

:Exit
popd
endlocal
exit /b

:GetIt
for /f "usebackq eol=! delims=" %%i in (`reg query %RKey%`) do (
  set iKey=%%i
  set iKey=!iKey:%RKey%=!
  echo !iKey!
  for /f "usebackq eol=! delims=" %%I in (`"reg query %RKey%!iKey! /v DisplayName 2>nul"`) do (
    set iName=%%I
    set iName=!iName:%RKey%=!
    set iName=!iName:DisplayName=%!
    set iName=!iName:REG_SZ=%!
    echo !iName!>>%RF%
    set iName=
  )
  set iKey=
)
exit /b
原文地址:https://www.cnblogs.com/caishuaichao/p/14462803.html