hope ur having good day;
so i am using GetFullPathName to get the path of powershell.exe in C programming language
:
i used this code here : parsing a path using a functoin called getfullpathname() in C? i used code here too: I have errors using GetFullPathName
whatever im using, im getting the following output:
Full path: C
if i debug it however i can see the rest of the path ...
last code i tried is:
TCHAR* fileExt;
TCHAR szDir[256];
GetFullPathName("powershell.exe", 256, szDir, &fileExt);
printf("Full path: %s\n", szDir);
i tried this for the same result:
char filename[] = "powershell.exe";
char fullFilename[MAX_PATH];
GetFullPathName(filename, MAX_PATH, fullFilename, NULL);
printf("Full path: %s\n", fullFilename);
i tried multiple code from here and there too, idk why but the output is always the same, and as i mentioned if i debug it i can see the full path, but i cant put it into the console, im using c and not cpp file , and using visual studio 2019.