Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
csaStartUpProgram.Add(Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce);

csaStartUpProgram.Add(Software\\Microsoft\\Windows\\CurrentVersion\\Run);

csaStartUpProgram.Add(SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce);

csaStartUpProgram.Add(SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run);

for(int nStartupProgram=0;nStartupProgram<csastartupprogram.getsize();nstartupprogram++)>
{



HKEY hKey;

if (RegOpenKey(HKEY_LOCAL_MACHINE,csaStartUpProgram[nStartupProgram],&hKey) == ERROR_SUCCESS)
{

DWORD dwValues, dwMaxValueNameLen, dwMaxValueLen;
LONG lRet = ::RegQueryInfoKey(hKey,
NULL, NULL, // lpClass, lpcClass
NULL, // lpReserved
NULL, NULL, // lpcSubKeys, lpcMaxSubKeyLen
NULL, // lpcMaxClassLen
&dwValues,
&dwMaxValueNameLen,
&dwMaxValueLen,
NULL, // lpcbSecurityDescriptor
NULL); // lpftLastWriteTime
if(ERROR_SUCCESS == lRet)
{
// allocate enough to fit max. length name and value
LPTSTR pszName = new TCHAR[dwMaxValueNameLen + 1];
LPBYTE lpData = new BYTE[dwMaxValueLen];
for(DWORD dwIndex = 0; dwIndex < dwValues; dwIndex++)
{
DWORD dwNameSize = dwMaxValueNameLen + 1;
DWORD dwValueSize = dwMaxValueLen;
DWORD dwType;
lRet = ::RegEnumValue(hKey, dwIndex, pszName, &dwNameSize,0, &dwType, lpData, &dwValueSize);
CString strName = pszName;
if(REG_SZ == dwType)
{
CString strValue = (LPCTSTR)lpData;


}
CLog::Log(strName + _T(""));
}
delete []pszName;
delete []lpData;
}
}
}`



I am getting output:

Communicator, SAP_WUS_UNT, BCSSync, Communicator, SAP_WUS_UNT, BCSSync,

Same output is repeating two times but i want all programs from above start up paths please help me...


I think it is pointing to WoW6432Node Path for Software\\Microsoft\\Windows\\CurrentVersion\\Run path also this may Win32 function pointing to Wow6432Node then how to get the programs from above path....... plz give me solution
Posted

1 solution

try this may be you get any help

C#
RegistryKey key =                           Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run");
         foreach (string Programs in key.GetValueNames())
         {
             string GetValue = key.GetValue(Programs).ToString();
             Console.WriteLine(getFilePath(GetValue));
         }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900