
[已解決]Setlocalenabledelayedexpansion導致搜索結果不正確錯在哪里最后由 踏沙行 于 -12-28 19:19已知:C:UsersAdministratorDesktop要刪除的趨勢注冊表信息officescan.txt的內容如下
【目的】篩選出只有注冊表項的行,篩選條件:行中沒有逗號【代碼1】nclick="copycode($('code0'));">復制代碼
- HKEY_CLASSES_ROOT*shellexContextMenuHandlersOfficeScan NT
- HKEY_CLASSES_ROOTCLSID{AF4F7471-FCFB-11d0-80B6-0080C838D5F9}InProcServer32, , C:Program Files (x86)AsiaInfoOfficeScan ClientTmdShell_64x.dll
- HKEY_CLASSES_ROOTDirectoryshellexContextMenuHandlersOfficeScan NT
- HKEY_CLASSES_ROOTDriveshellexContextMenuHandlersOfficeScan NT
- HKEY_CLASSES_ROOTTypeLib{A00B957E-3315-46CB-B090-9EF2187641E2}1.0win32, , C:Program Files (x86)AsiaInfoOfficeScan ClientperfiCrcPerfMonMgr.dll
- HKEY_CLASSES_ROOTWow6432NodeTypeLib{A00B957E-3315-46CB-B090-9EF2187641E2}1.0win32, , C:Program Files (x86)AsiaInfoOfficeScan ClientperfiCrcPerfMonMgr.dll
- HKEY_CURRENT_USERSoftwareClassesLocal SettingsSoftwareMicrosoftWindowsShellBagMRU2311, 1, 68 00 31 00 00 00 00 00 96 4d 11 2a 10 00 4f 46 46 49 43 45 7e 31 00 00 50 00 08 00 04 00 ef be 96 4d 33 11 96 4d 11 2a 2a 00 00 00 1e 56 00 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4f 00 66 00 66 00 69 00 63 00 65 00 53 00 63 00 61 00 6e 00 20 00 43 00 6c 00 69 00 65 00 6e 00 74 00 00 00 18 00 00 00
- HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerStartPage2, ProgramsCache, 13 00 00 00 c3 53 5b 62 48 ab c1 4e ba 1f a1 ef 41 46 fc 19 00 80 00 00 00 7e 00 31 00 00 00 00 00 93 4d 30 2f 11 00 50 72 6f 67 72 61 6d 73 00 00 66 00 08 00 04 00 ef be 8f 4d 5b 1c 93 4d 30 2f 2a 00 00 00 3a 02 00 00 00 00 07 00 00 00 00 00 00 00 00 00 3c 00 00 00 00 00 50 00 72 00 6f 00 67 00 72 00 61 00 6d 00 73 00 00 00 40 00 73 00 68 00 65 00 6c 00 6c 00 33 00 32 00 2e 00 64 00 6c 00 6c 00 2c 00 2d 00 32 00 31 00 37 00 38 00 32 00 00 00 18 00 00 00 01 2e 02 00 00 2c 02 32 00 39 05 00 00 92 4d 13 03 20 00 49 4e 54 45 52 4e 7e 32 2e 4c 4e 4b 00 00 a6 00 08 00 04 00 ef be 8f 4d 62 1c 8f 4d 62 1c 2a 00 00 00 73 19 00 00 00 00 0c 00 00 00 00 00 00 00 00 00 56 00 00 00 00 00 49 00 6e 00 74 00 65 00 72 00 6e 00 65 00 74 00 20 00 45 00 78 00 70 00 6c 00 6f 00 72 00 65 00 72 00 2e 00 6c 00 6e 00 6b 00 00 00 40 00 43 00 3a 00 5c 00 57 00 69 00 6e 00 64 00 6f 00 77 00 73 00 5c 00 53 00 79 00 73 00 74 00 65 00 6d 00 33 00 32 00 5c 00 69 00 65 00 34 00 75 00 69 00 6e 00 69 00 74 00 2e 00 65 00 78 00 65 00 2c 00 2d 00 37 00 33 00 34 00 00 00 1c 00 6a 01 05 00 0b 00 ef be 00 00 00 00 00 00 00 00 43 00 3a 00 5c 00 50 00 72 00 6f 00 67 00 72 00 61 00 6d 00 20 00 46 00 69 00 6c 00 65 00 73 00 5c 00 49 00 6e 00 74 00 65 00 72 00 6e 00 65 00 74 00 20 00 45 00 78 00 70 00 6c 00 6f 00 72 00 65 00 72 00 5c 00 69 00 65 00 78 00 70 00 6c 00 6f 00 72 00 65 00 2e 00 65 00 78 00 65 00 00 00 00 00 00 00 4d 00 69 00 63 00 72 00 6f 00 73 00 6f 00 66 00 74 00 2e 00 49 00 6e 00 74 00 65 00 72 00 6e 00 65 00 74 00 45 00 78 00 70 00 6c 00 6f 00 72 00 65 00 72 00 2e 00 44 00 65 00 66 00 61 00 75 00 6c 00 74 00 00 00 00 00 cf ca e9 5c 33 98 d4 01 4b a6 7e 29 27 94 d4 01 01 00 00 00 01 00 00 00 00 00 00 00 7b 00 36 00 44 00 38 00 30 00 39 00 33 00 37 00 37 00 2d 00 36 00 41 00 46 00 30 00 2d 00 34 00 34 00 34 00 42 00 2d 00 38 00 39 00 35 00 37 00 2d 00 41 00 33 00 37 00 37 00 33 00 46 00 30 00 32 00 32 00 30 00 30 00 45 00 7d 00 5c 00 49 00 6e 00 74 00 65 00 72 00 6e 00 65 00 74 00 20 00 45 00 78 00 70 00 6c 00 6f 00 72 00 65 00 72 00 5c 00 69 00 65 00 78 00 70 00 6c 00 6f 00 72 00 65 00 2e 00 65 00 78 00 65 00 00 00 00 00 00 00 1c 00 00 00 00 04 01 00 00 7e 00 31 00 00 00 00 00 93 4d 30 2f 11 00 50 72 6f 67 72 61 6d 73 00 00 66 00 08 00 04 00 ef be 8f 4d 5b 1c 93 4d 30 2f 2a 00 00 00 3a 02 00 00 00 00 07 00 00 00 00 00 00 00 00 00 3c 00 00 00 00 00 50 00 72 00 6f 00 67 00 72 00 61 00 6d 00 73 00 00 00 40 00 73 00 68 00 65 00 6c 00 6c 00 33 00 32 00 2e 00 64 00 6c 00 6c 00 2c 00 2d 00 32 00 31 00 37 00 38 00 32 00 00 00 18 00 84 00 31 00 00 00 00 00 ee 3a d1 26 11 00 41 43 43 45 53 53 7e 31 00 00 6c 00 08 00 04 00 ef be 8f 4d 5b 1c 8f 4d 5b 1c 2a 00 00 00 3c 02 00 00 00 00 05 00 00 00 00 00 00 00 00 00 42 00 00 00 00 00 41 00 63 00 63 00 65 00 73 00 73 00 6f 00 72 00 69 00 65 00 73 00 00 00 40 00 73 00 68 00 65 00 6c 00 6c 00 33 00 32 00 2e 00 64 00 6c 00 6c 00 2c 00 2d 00 32 00 31 00 37 00 36 00 31 00 00 00 18 00 00 00 01 c0 01 00 00 be 01 32 00 00 05 00 00 ee 3a ce 26 20 00 43 4f 4d 4d 41 4e 7e 31 2e 4c 4e 4b 00 00 7a 00 08 00 04 00 ef be 8f 4d
- HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionShell ExtensionsApproved, {AF4F7471-FCFB-11d0-80B6-0080C838D5F9}, OfficeScan NT
- HKEY_LOCAL_MACHINESOFTWARETrendMicroAMSP, InstallDir, C:Program Files (x86)AsiaInfoOfficeScan ClientCCSF
- HKEY_LOCAL_MACHINESOFTWARETrendMicroOspreyScanCommonAntiSpamconfig, RulePath, C:Program Files (x86)AsiaInfoOfficeScan ClientAspmData
- HKEY_LOCAL_MACHINESOFTWARETrendMicroOspreyScanCommonMailManagerconfig, DisclaimerSubject, Trend Micro OfficeScan detected and took action on a malicious email
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesTypeLib{A00B957E-3315-46CB-B090-9EF2187641E2}1.0win32, , C:Program Files (x86)AsiaInfoOfficeScan ClientperfiCrcPerfMonMgr.dll
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionRun, OfficeScanNT Monitor, C:Program Files (x86)AsiaInfoOfficeScan Clientpccntmon.exe -HideWindow
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionRun, OfficeScanNT Monitor, C:Program Files (x86)AsiaInfoOfficeScan Clientpccntmon.exe -HideWindow
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstallOfficeScanNT
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstallOfficeScanNT, UninstallString, C:Program Files (x86)AsiaInfoOfficeScan Clientntrmv.exe
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstallOfficeScanNT, DisplayIcon, C:Program Files (x86)AsiaInfoOfficeScan ClientPccntmon.exe
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeTrendMicroPC-cillinNTCorpCurrentVersion, Application Path, C:Program Files (x86)AsiaInfoOfficeScan Client
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeTrendMicroPC-cillinNTCorpCurrentVersion, VirtualPath, /officescan/cgi
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeTrendMicroPC-cillinNTCorpCurrentVersionMisc., ProductName, OfficeScan (common client)
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeTrendMicroPC-cillinNTCorpCurrentVersionReal Time Scan Configuration, VSApiNTHome, C:Program Files (x86)AsiaInfoOfficeScan Client
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetserviceseventlogApplicationTMNotify, CategoryMessageFile, C:Program Files (x86)AsiaInfoOfficeScan ClientTMNotify.dll
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetserviceseventlogApplicationTMNotify, EventMessageFile, C:Program Files (x86)AsiaInfoOfficeScan ClientTMNotify.dll
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetserviceseventlogApplicationTMNotify, ParameterMessageFile, C:Program Files (x86)AsiaInfoOfficeScan ClientTMNotify.dll
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesntrtscan, ImagePath, C:Program Files (x86)AsiaInfoOfficeScan Clientntrtscan.exe
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesntrtscan, DisplayName, OfficeScan NT RealTime Scan
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesPerf_iCrcPerfMonMgrPerformance, Library, C:Program Files (x86)AsiaInfoOfficeScan ClientperfiCrcPerfMonMgr.dll
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicestmccsf, ImagePath, C:Program Files (x86)AsiaInfoOfficeScan ClientCCSFtmccsf.exe
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicestmccsf, DisplayName, OfficeScan Common Client Solution framework
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesTmFilter, ImagePath, ??C:Program Files (x86)AsiaInfoOfficeScan ClientTmXPFlt.sys
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesTmFilter, CurrentPatternName, C:Program Files (x86)AsiaInfoOfficeScan Clientssaptn.910
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicestmlisten, ImagePath, C:Program Files (x86)AsiaInfoOfficeScan Clienttmlisten.exe
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicestmlisten, DisplayName, OfficeScan NT Listener
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesTmPreFilter, ImagePath, ??C:Program Files (x86)AsiaInfoOfficeScan ClientTmPreFlt.sys
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicestmumh, HPCCache, DeviceHarddiskVolume1Program Files (x86)AsiaInfoOfficeScan ClientCCSFmodule20019hpc.ts
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicestmumh, DCLCache, DeviceHarddiskVolume1Program Files (x86)AsiaInfoOfficeScan ClientCCSFmodule20019dcl.ts
- HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesVSApiNt, ImagePath, ??C:Program Files (x86)AsiaInfoOfficeScan ClientVSApiNt.sys
【結果】正確,結果如下:nclick="copycode($('code1'));">復制代碼
- type C:UsersAdministratorDesktop要刪除的趨勢注冊表信息officescan.txt|sed -n /,/!p
============【代碼2】nclick="copycode($('code2'));">復制代碼
- HKEY_CLASSES_ROOT*shellexContextMenuHandlersOfficeScan NT
- HKEY_CLASSES_ROOTDirectoryshellexContextMenuHandlersOfficeScan NT
- HKEY_CLASSES_ROOTDriveshellexContextMenuHandlersOfficeScan NT
- HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstallOfficeScanNT
【結果】錯誤,結果把所有內容全部顯示出來了===========【疑惑】為什么Setlocal enabledelayedexpansion會導致結果出錯呢?根本原因在哪里?nclick="copycode($('code3'));">復制代碼
- Setlocal enabledelayedexpansion
- type C:UsersAdministratorDesktop要刪除的趨勢注冊表信息officescan.txt|sed -n /,/!p

