My programm is launched via the context menu by rightclicking in any folder and clicking on it.
My programm is required to obtain the path to the folder where the user has rightclicked in.
Until now i have used the a registry key like this:

Here I use the %w argument to seemingly obtain the current working directory into argv[1].
As a tiny reproduction I would eg cout the path like this:
int main(int argc, char* argv[])
{
std::cout << std::string(argv[1]) << std::endl;
std::cin.ignore();
}
For some reason though some folders just arent working with this approach. Normally i would get a path like C:\Sciebo. Which is excatly what I want.
But eg the Programm Files folders in windows both just return the same C:\Program, which isn't a real directory.
Even when used on other folders deeper inside of the Programm Files folders they return the same C:\Program.
This also occurs when using a wstring approach with wmain.
Does anyone have an idea what this is caused by and at best how to work around it? Thank you for everything!