Navicat17重置试用脚本

Bat脚本

reset_navicat.bat
@echo off

:: 针对navicat15
:: reg delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Registration14XCS /f

:: 针对navicat16,英文版用户需将 `NavicatPremium\Registration16XCS` 更改为 `NavicatPremium\Registration16XEN`
:: reg delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Registration16XCS /f

:: 针对navicat17
echo reg delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Registration17XCS /f
reg delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Registration17XCS /f

:: 通用
echo reg delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Update /f
reg delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Update /f

:: 备份CLSID,如果出现什么问题,请使用备份reg进行恢复
set filename=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
set "filename=%filename: =0%"
reg export HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID %HOME%\Desktop\CLSID%filename%.reg

setlocal enabledelayedexpansion

set dn=Info
set dn2=ShellFolder
set rp=HKEY_CURRENT_USER\Software\Classes\CLSID

for /f "tokens=*" %%a in ('reg query "%rp%"') do (

for /f "tokens=*" %%l in ('reg query "%%a" /f "%dn%" /s /e ^|findstr /i "%dn%"') do (
echo deleteing Info: %%a
reg delete %%a /f
)

for /f "tokens=*" %%l in ('reg query "%%a" /f "%dn2%" /s /e ^|findstr /i "%dn2%"') do (
set flag=false

for /f "tokens=*" %%k in ('reg query "%%l" /s') do (
set flag=true
)

if /i "!flag!"=="false" (
echo deleteing ShellFolder: %%a
reg delete %%a /f
)
)

)

pause

参考