vs2010 自动删除 feature pack 添加的注册表方法

1.创建一个批处理文件 DeleteReg.bat ,内容如下:

@echo off
SET TargetName=%1

REG QUERY "HKEY_CURRENT_USER/Software/Local AppWizard-Generated Applications/%TargetName%" /s >nul 2>nul
if %errorlevel% equ 0 ( 
        echo %TargetName% 表项已存在。
        REG DELETE "HKEY_CURRENT_USER/Software/Local AppWizard-Generated Applications/%TargetName%" /f >nul 2>nul
        echo 已刪除表项 %TargetName%
) else (
        echo %TargetName%  表项不存在!
)

2.在工程属性的生成后事件中(Post-build Event)添加 DeleteReg.bat $(TargetName) 即可。

你可能感兴趣的:(delete,query,2010)