- How to track changes in Windows Registry?
- How to track changes in Windows Registry?
- RegShot
- Registry Live Watch
- WhatChaged
- Comparing two variants of the Windows registry without third-party software
- 5 best tools for monitoring registry changes in Windows 10
- What are the best tools to keep track of registry changes on Windows 10?
- Regshot
- WhatChanged
- RegFromApp
- Run a System Scan to discover potential errors
- Process Monitor
- Reg and FC
- Отслеживание изменений в EF Core Change Tracking in EF Core
- Как отслеживать сущности How to track entities
- Состояния сущностей Entity states
- Отслеживание из запросов Tracking from queries
- Простой запрос и обновление Simple query and update
- Запрос, вставка, обновление и удаление Query then insert, update, and delete
How to track changes in Windows Registry?
How to track changes in Windows Registry?
Sometimes it may be necessary to track changes made by programs or settings in the Windows registry. For example, for the subsequent cancellation of these changes or to find out how certain parameters (for example, appearance settings, OS updates) are written to the registry. We will deal with that question using some software and File Comparison tool.
RegShot
This is one of the most popular programs which helps to keep track of registry changes. The process of exploitation the program is as following:
- Run the RegShot using depending on whether your system is 32-bit (x86) or 64-bit (x64)
- Click the “1st shot” button and then the “shot” button which will appear below (in the process of creating the registry shot it may seem that the program is frozen, this is not true – the process may take several minutes to proceed)
3. Make changes to the registry (change settings, install the program, etc.). This wil be included to report after the second shot.
4. Click the “2nd shot” button and create a second registry shot.
5. Click the Compare button (the report will be saved in Output Path folder).
6. After comparing the report will be automatically opened and it will be possible to see which registry settings have been changed.
7. If you need to clean the registry shots, click the “Clear” button.
Please note that in the report, you can see much more information on changed registry settings that were actually made by your actions or programs. It is all OK since Windows itself often changes registry settings during operation (e.g. maintenance, checking for viruses, checking for updates, etc.)
Registry Live Watch
The freeware Registry Live Watch works using slightly different principle: not by comparing two Windows registry shots, but by monitoring changes in real time. However, the program does not display the changes themselves but merely reports that such a change has occurred.
- After starting the program in the top field, specify which registry key you want to track (i.e. it cannot monitor the entire registry at once).
2. Click “Start Monitor” and messages about observed changes will be immediately displayed in the list at the bottom of the program window.
2. If necessary, you can save the changes using the Save Log button.
WhatChaged
Another program to find out what has changed in the Windows 10, 8 or Windows 7 registry is WhatChanged. Its use is very similar to RegShot.
- In the Scan Items section, check “Scan Registry” (the program can also track file changes) and check those registry keys that need to be tracked.
- Click the “Step 1 – Get Baseline State” button.
3. After changes in the registry, click on the Step 2 button to compare the initial state with the changed one.
4. A report (WhatChanged_Snapshot2_Registry_HKCU.txt file) containing information about the changed registry settings will be saved in the program folder.
Comparing two variants of the Windows registry without third-party software
Windows has a built-in file comparison tool, fc.exe (File Comparison), which can be used to compare two search branch of a registry.
To do this, use the Windows Registry Editor to export the necessary registry branch (right-click on the section – export) before the changes and after the changes with different file names, for example, 1.reg and 2.reg.
Then use a command like a command line:
fc c: \ 1.reg c: \ 2.reg> c: \ log.txt
Here we can see the paths to the two registry files first, and then the path to the text file of the comparison results.
Unfortunately, the method is not suitable for tracking major changes, but only for some small registry key with a couple of parameters where the change is supposed to happen and the fact of the change is most likely to be tracked.
5 best tools for monitoring registry changes in Windows 10
- Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
- Click Start Scan to find Windows issues that could be causing PC problems.
- Click Repair All to fix issues affecting your computer’s security and performance
- Restoro has been downloaded by 0 readers this month.
Here are the software solutions mentioned in this guide:
When you install a certain software, it copies a few files into your registry, and it could cause some problems sometimes. The solution for this problem is to monitor registry changes, find the error, and reset it back to normal.
To help you find the best solution for monitoring registry, we present you the list of best registry-monitoring software and tools.
What are the best tools to keep track of registry changes on Windows 10?
Regshot
Regshot is very useful tool for monitoring changes in your registry. Besides showing the current state of your Windows registry, it allows you to take a screenshot of it and save it for later comparison.
Regshot is an open-source tool.
This free monitoring utility works on both 32-bit and 64-bit versions of previous Windows operating system, and it will work on all versions of Windows 10 without any problems.
Besides Windows registry, Regshot also allows you to take a snapshot of the Windows directories. You can download this open-source registry monitoring tool from SourceForge for free.
WhatChanged
WhatChanged is another well-known, free registry utility for tracking changes of Windows registry.
WhatChanged uses so-called ‘brute force method,’ and with it you’ll be able to scan your registry to find the modified files and recent registry entries, so that makes it easy to compare all the changes of your system settings.
WhatChanged is a great tool for checking what are the programs you installed recently, and maybe delete some unnecessary ones.
WhatChanged is available for free download from Major Geeks.
RegFromApp
RegFromApp is a registry monitoring tool that smoothly monitors all the changes in the registry made by Windows or a certain program you selected.
It also creates a RegEdit registration file (.reg) which stores all registry changes and modifications made by the program or an app you installed.
Run a System Scan to discover potential errors
This .reg file could be used to import all registry changes with RegEditApp, if needed. You can download RegFromApp for free from its developer’s website, nirsoft.net.
Process Monitor
Process Monitor is another very popular, free registry monitoring utility, that offers some advanced options. It works in real time and shows all system files, registry changes and processes/threads of your system.
This tiny tool is also able to fix your registry, if there are some errors, as well as to remove malware and other types of malicious software.
You can download this small, but powerful registry tool fro free from TechNet.
Reg and FC
And now something for those who don’t like using third-party software for performing system tasks, or any other tasks in Windows 10.
Reg and FC is Windows’ built-in command line from Windows registry, which allows you to monitor and compare states of your registry.
Before comparing the registry changes, export all the important registry keys you want to monitor (when your system is performing well) to a text file, and export these keys again after a few changes or new installations.
Now compare the both files with fc.exe:
- Go to search and type fc.exe
- Open fc command and enter the following command line:
- fc 1st.reg 2nd.reg > result.txt
This command will compare both files and save them in the same directory as .text file.
Now, you know what tools you can install on your Windows 10 computer in order to keep an eye on the Registry changes that various apps and software operate on the OS.
Knowing what’s changed is one thing, but knowing how to revert the changes is another one.
So, if you want to simply get rid of all the changes, you can use a Restore Point — provided that you already created one.
For more information on how to create a Restore Point and use it to actually restore your Registry, you can check out these step-by-step guides:
Additionally, if you want to reset your Registry, you can also install one of these Registry Cleaners and run it on your machine.
We hope that you’ll find at least one of these tools useful, and that it will help you to monitor registry changes easily.
If you have some comments, suggestions, or maybe know some other powerful tools for monitoring registry changes, reach us in the comments below, we would love to hear your opinion.
RELATED STORIES TO CHECK OUT:
Отслеживание изменений в EF Core Change Tracking in EF Core
Каждый экземпляр DbContext отслеживает изменения, внесенные в сущности. Each DbContext instance tracks changes made to entities. Эти отслеживаемые сущности, в свою очередь, записывают изменения в базу данных при вызове SaveChanges. These tracked entities in turn drive the changes to the database when SaveChanges is called.
В этом документе представлены общие сведения об отслеживании изменений Entity Framework Core (EF Core) и о том, как это связано с запросами и обновлениями. This document presents an overview of Entity Framework Core (EF Core) change tracking and how it relates to queries and updates.
Вы можете запустить и отладить весь код, используемый в этой документации, скачав пример кода из GitHub. You can run and debug into all the code in this document by downloading the sample code from GitHub.
Для простоты в этой документации используются и описываются синхронные методы, такие как SaveChanges, а не их асинхронные эквиваленты, такие как SaveChangesAsync. For simplicity, this document uses and references synchronous methods such as SaveChanges rather than their async equivalents such as SaveChangesAsync. Вызов и ожидание асинхронного метода можно заменить, если не указано иное. Calling and awaiting the async method can be substituted unless otherwise noted.
Как отслеживать сущности How to track entities
Экземпляры сущностей отслеживаются, если они: Entity instances become tracked when they are:
- получены из запросов к базе данных; Returned from a query executed against the database
- явно присоединены к DbContext с помощью Add , Attach , Update или аналогичных методов; Explicitly attached to the DbContext by Add , Attach , Update , or similar methods
- обнаружены как новые сущности, подключенные к существующим отслеживаемым сущностям. Detected as new entities connected to existing tracked entities
Экземпляры сущностей больше не отслеживаются, если: Entity instances are no longer tracked when:
- экземпляр DbContext удален; The DbContext is disposed
- средство отслеживания изменений очищено (EF Core 5.0 и более поздних версий); The change tracker is cleared (EF Core 5.0 and later)
- сущности явно окончательно удалены. The entities are explicitly detached
DbContext используется для представления кратковременной единицы работы, как описано в статье Время существования, настройка и инициализация DbContext. DbContext is designed to represent a short-lived unit-of-work, as described in DbContext Initialization and Configuration. Это означает, что удаление DbContext — это обычный способ остановки отслеживания сущностей. This means that disposing the DbContext is the normal way to stop tracking entities. Иными словами, время существования DbContext должно быть следующим: In other words, the lifetime of a DbContext should be:
- Создание экземпляра DbContext. Create the DbContext instance
- Отслеживание определенных сущностей. Track some entities
- Внесение определенных изменений в сущности. Make some changes to the entities
- Вызов метода SaveChanges для обновления базы данных. Call SaveChanges to update the database
- Удаление экземпляра DbContext. Dispose the DbContext instance
Вам не нужно очищать средство отслеживания изменений или явно окончательно удалять экземпляры сущностей при использовании этого подхода. It is not necessary to clear the change tracker or explicitly detach entity instances when taking this approach. Но, если необходимо окончательно удалить сущности, более эффективным будет вызов ChangeTracker.Clear, чем удаление сущностей по одной. However, if you do need to detach entities, then calling ChangeTracker.Clear is more efficient than detaching entities one-by-one.
Состояния сущностей Entity states
Каждая сущность связана с заданным состоянием EntityState: Every entity is associated with a given EntityState:
- Сущности Detached не отслеживаются DbContext. Detached entities are not being tracked by the DbContext.
- Сущности Added являются новыми и еще не вставлены в базу данных. Added entities are new and have not yet been inserted into the database. Это означает, что они будут вставлены при вызове SaveChanges. This means they will be inserted when SaveChanges is called.
- Сущности Unchanged не изменены, так как они были запрошены из базы данных. Unchanged entities have not been changed since they were queried from the database. Все сущности, получаемые из запросов, изначально находятся в этом состоянии. All entities returned from queries are initially in this state.
- Сущности Modified были изменены с момента запроса из базы данных. Modified entities have been changed since they were queried from the database. Это означает, что они будут обновлены при вызове SaveChanges. This means they will be updated when SaveChanges is called.
- Сущности Deleted существуют в базе данных, но отмечены для удаления при вызове SaveChanges. Deleted entities exist in the database, but are marked to be deleted when SaveChanges is called.
EF Core отслеживает изменения на уровне свойств. EF Core tracks changes at the property level. Например, если изменяется только одно значение свойства, обновление базы данных изменит только это значение. For example, if only a single property value is modified, then a database update will change only that value. При этом свойства помечаются как измененные, только если сущность находится в состоянии Modified. However, properties can only be marked as modified when the entity itself is in the Modified state. (С другой стороны, состояние Modified означает, что хотя бы одно значение свойства помечено как измененное.) (Or, from an alternate perspective, the Modified state means that at least one property value has been marked as modified.)
В следующей таблице описаны различия между состояниями. The following table summarizes the different states:
Состояние сущностей Entity state | Отслеживается DbContext Tracked by DbContext | Существует в базе данных Exists in database | Измененные свойства Properties modified | Действие при вызове SaveChanges Action on SaveChanges |
---|---|---|---|---|
Detached | Нет No | — | — | — |
Added | Да Yes | Нет No | — | Вставить Insert |
Unchanged | Да Yes | Да Yes | Нет No | — |
Modified | Да Yes | Да Yes | Да Yes | Update Update |
Deleted | Да Yes | Да Yes | — | Удалить Delete |
В этом тексте для ясности используются термины, связанные с реляционной базой данных. This text uses relational database terms for clarity. Базы данных NoSQL обычно поддерживают аналогичные операции, но, возможно, с другими именами. NoSQL databases typically support similar operations but possibly with different names. Дополнительные сведения см. в документации поставщика базы данных. Consult your database provider documentation for more information.
Отслеживание из запросов Tracking from queries
Отслеживание изменений EF Core наиболее эффективно, когда один и тот же экземпляр DbContext используется для запрашивания сущностей и их обновления путем вызова SaveChanges. EF Core change tracking works best when the same DbContext instance is used to both query for entities and update them by calling SaveChanges. Это происходит потому, что EF Core автоматически отслеживает состояние запрашиваемых сущностей и определяет изменения, внесенные в эти сущности при вызове SaveChanges. This is because EF Core automatically tracks the state of queried entities and then detects any changes made to these entities when SaveChanges is called.
Этот подход имеет несколько преимуществ по сравнению с явным отслеживанием экземпляров сущностей: This approach has several advantages over explicitly tracking entity instances:
- Он является простым. It is simple. Состояниями сущностей редко требуется управлять явным образом — EF Core следит за изменениями состояния. Entity states rarely need to be manipulated explicitly—EF Core takes care of state changes.
- Обновления ограничиваются только теми значениями, которые действительно изменились. Updates are limited to only those values that have actually changed.
- Значения теневых свойств сохраняются и используются по мере необходимости. The values of shadow properties are preserved and used as needed. Это особенно важно, если внешние ключи хранятся в теневом состоянии. This is especially relevant when foreign keys are stored in shadow state.
- Исходные значения свойств сохраняются автоматически и используются для эффективного обновления. The original values of properties are preserved automatically and used for efficient updates.
Простой запрос и обновление Simple query and update
Например, рассмотрим простую модель с участием блогов и публикаций: For example, consider a simple blog/posts model:
Эту модель можно использовать для запрашивания блогов и публикаций с последующим внесением определенных обновлений в базу данных: We can use this model to query for blogs and posts and then make some updates to the database:
e.Posts).First(e => e.Name == «.NET Blog»); blog.Name = «.NET Blog (Updated!)»; foreach (var post in blog.Posts.Where(e => !e.Title.Contains(«5.0»))) < post.Title = post.Title.Replace("5", "5.0"); >context.SaveChanges(); —>
Вызов SaveChanges приводит к следующим обновлениям базы данных с использованием SQLite в качестве примера базы данных: Calling SaveChanges results in the following database updates, using SQLite as an example database:
Представление отладки средства отслеживания изменений — это удобный способ визуализации отслеживаемых сущностей и их состояния. The change tracker debug view is a great way visualize which entities are being tracked and what their states are. Например, перед вызовом SaveChanges вставьте следующий код в приведенный выше пример: For example, inserting the following code into the sample above before calling SaveChanges:
Будут получены следующие выходные данные: Generates the following output:
Учитывайте следующее: Notice specifically:
- Свойство Blog.Name помечено как измененное ( Name: ‘.NET Blog (Updated!)’ Modified Originally ‘.NET Blog’ ), что приводит к тому, что состояние блога изменяется на Modified . The Blog.Name property is marked as modified ( Name: ‘.NET Blog (Updated!)’ Modified Originally ‘.NET Blog’ ), and this results in the blog being in the Modified state.
- Свойство Post.Title публикации 2 помечено как измененное ( Title: ‘Announcing F# 5.0’ Modified Originally ‘Announcing F# 5’ ), что приводит к тому, что состояние публикации изменяется на Modified . The Post.Title property of post 2 is marked as modified ( Title: ‘Announcing F# 5.0’ Modified Originally ‘Announcing F# 5’ ), and this results in this post being in the Modified state.
- Другие значения свойств публикации 2 не изменились и поэтому не помечаются как измененные. The other property values of post 2 have not changed and are therefore not marked as modified. Именно поэтому эти значения не включаются в обновление базы данных. This is why these values are not included in the database update.
- Другая публикация вообще не была изменена. The other post was not modified in any way. Именно поэтому она по-прежнему находится в состоянии Unchanged и не включается в обновление базы данных. This is why it is still in the Unchanged state and is not included in the database update.
Запрос, вставка, обновление и удаление Query then insert, update, and delete
Такие обновления, как в предыдущем примере, можно сочетать с операциями вставки и удаления в одной единице работы. Updates like those in the previous example can be combined with inserts and deletes in the same unit-of-work. Пример: For example:
e.Posts).First(e => e.Name == «.NET Blog»); // Modify property values blog.Name = «.NET Blog (Updated!)»; // Insert a new Post blog.Posts.Add(new Post < Title = "What’s next for System.Text.Json?", Content = ".NET 5.0 was released recently and has come with many. " >); // Mark an existing Post as Deleted var postToDelete = blog.Posts.Single(e => e.Title == «Announcing F# 5»); context.Remove(postToDelete); context.ChangeTracker.DetectChanges(); Console.WriteLine(context.ChangeTracker.DebugView.LongView); context.SaveChanges(); —>
В этом примере: In this example:
- Блог и связанные с ним публикации запрашиваются из базы данных и отслеживаются. A blog and related posts are queried from the database and tracked
- Свойство Blog.Name изменяется. The Blog.Name property is changed
- В коллекцию существующих записей блога добавляется новая публикация. A new post is added to the collection of existing posts for the blog
- Существующая публикация помечается для удаления путем вызова DbContext.Remove. An existing post is marked for deletion by calling DbContext.Remove
Еще раз взгляните на представление отладки средства отслеживания изменений перед вызовом команды SaveChanges. Вы увидите, как EF Core отслеживает эти изменения: Looking again at the change tracker debug view before calling SaveChanges shows how EF Core is tracking these changes:
Обратите внимание на указанные ниже моменты. Notice that:
- Блог помечен как Modified . The blog is marked as Modified . Это вызовет обновление базы данных. This will generate a database update.
- Публикация 2 помечена как Deleted . Post 2 is marked as Deleted . Это вызовет удаление базы данных. This will generate a database delete.
- Новая публикация с временным идентификатором связана с блогом 1 и помечена как Added . A new post with a temporary ID is associated with blog 1 and is marked as Added . Это вызовет вставку в базу данных. This will generate a database insert.
Это приводит к выполнению следующих команд базы данных (при использовании SQLite) при вызове SaveChanges: This results in the following database commands (using SQLite) when SaveChanges is called:
Дополнительные сведения о вставке и удалении сущностей см. в статье Явное отслеживание сущностей. See Explicitly Tracking Entities for more information on inserting and deleting entities. Дополнительные сведения о том, как EF Core автоматически обнаруживает подобные изменения, см. в статье Обнаружение изменений и уведомления. See Change Detection and Notifications for more information on how EF Core automatically detects changes like this.