Hi guys I have a strange issue.
I am trying to get list of all startup programs from Registry - LocalMachine,CurrentUser, subkeys Run, RunOnce, RunOnceEx. And after that I can get list of links in Startup folder
For Win64 I found that startup programs are in this key
LocalMachine/Software/Wow6432Node/Microsoft/Windows/CurrentVersion/Run
The problem is in this code, running it I get List of apps which are in different Subkey LocalMachine\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run instead of the described bellow LocalMachine\Software\Microsoft\Windows\CurrentVersion\Run
Is that normal?
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", false);
foreach (string appName in key.GetValueNames())
{
try
{
MessageBox.Show(appName);
}
catch (Exception ex)
{
}
}
I tryed using this WMI solution but it didnt get all startup apps. That's why i decided to get them manually from the Registry.
Is this script correct and why it doesn't do what it is supposed to do?
Is there any other way to get all startup apps and processes?
Thanks