1 用批处理修改注册表

建立bat批处理文件

@echo offecho windows registry editor version 5.00 >
echo 正在禁用注册表中相应的自动运行项,请稍候…
echo [hkey_current_usersoftwareMicrosoftwindowscurrentversionpoliciesexplorer] >>
echo "disableLocalMachinRun"=dword:00000001 >>
echo "disableLocalMachinRunonce"=dword:00000001 >>
echo "disableCurrentUserRun"=dword:00000001 >>
echo "disableCurrentUserRunonce"=dword:00000001 >>
echo 成功按要求禁用了注册表中相应的运行项
echo.
regedit /s
del /q /f >nul

上述的思路主要分两步,首先是用批处理自动建立文件,然后用命令regedit /s导入文件。

2 使用dos命令

@reg add "HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerMain" /v "Start Page" /d "; /f

3 使用C++CRegKey类

#include <a;

int main()

{

CRegKey reg;

reg.Create(HKEY_CLASSES_ROOT,"*\shell\file1");

reg.SetValue("腾讯QQ");

reg.Create;command");

char exeName[MAX_PATH]="D:\Program Files\qq\FinePlus.exe";

reg.SetValue(ExeName,"D:\Program Files\qq\FinePlus.exe");

reg.Close();

return 0;

}

1 导出注册表分支

_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun

注册表reg文件内容如下:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun]

"RavTRAY"=""C:\Program Files\Rising\Rav\RSTRAY.EXE" -system"

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOptionalComponents]

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOptionalComponentsIMAIL]

"Installed"="1"

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOptionalComponentsMAPI]

"NoChange"="1"

"Installed"="1"

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOptionalComponentsMSFS]

"Installed"="1"

上述导出的注册表文件双击可直接导入到系统的注册表中。

-End-

相关推荐