tell me how to programmatically get a list of all launched files from the Start Menu when the system starts, where to look tell me. Thank you in advance.
- Specific files in the user folder? It's just that there are a lot of these places whence starting. - AK ♦
|
1 answer
If you need an autorun list, you can get it from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
For example:
using (var key = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run")) { var valueNames = key.GetValueNames(); Dictionary<string, string> apps = valueNames.Where(valueName => key.GetValueKind(valueName) == RegistryValueKind.String).ToDictionary(valueName => valueName, valueName => key.GetValue(valueName).ToString()); } |