What is the best way to find out where notepad.exe and mspaint.exe are that will work across various versions of Windows?
Should I get the Windows directory via SHGetFol
Since you tagged the question with WinAPI, I'd use SearchPath() e.g. the following will populate the variable path with the result.
path
//Get the full path to notepad char path[MAX_PATH] = { 0 }; LPSTR* ptr = NULL; DWORD dwRet = SearchPath(NULL, "notepad.exe", NULL, MAX_PATH, (LPSTR)path, ptr);