PDA

Показать полную графическую версию : [решено] Удаление найденных параметров реестра


Omnividente
26-12-2011, 11:32
Всем привет. Помогите батник со следующими функциями.
Поиск в указанной ветке реестре параметра содержащего "Uchitel", и удаление всех параметров. Вот пример вывода команды:

reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders" | find /i "Uchitel"

C:\Documents and Settings\kozhekin\Local Settings\Application Data\Uchitel\Rec\ REG_SZ
C:\Documents and Settings\kozhekin\Local Settings\Application Data\Uchitel\ REG_SZ
C:\Program Files\Common Files\Uchitel\ REG_SZ
C:\Documents and Settings\kozhekin.UCH\Local Settings\Application Data\Uchitel\Rec\ REG_SZ
C:\Documents and Settings\kozhekin.UCH\Local Settings\Application Data\Uchitel\ REG_SZ
Заранее спасибо

@echo off
for /f "tokens=1 delims= " %%a in ('reg.exe query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders" ^| findstr /i "Uchitel" ') do (
for /f "tokens=*" %%b in ("%%a") do reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders" /v "%%b\" /f
)

Решено :)




© OSzone.net 2001-2012