file - C++ - How to get the desktop path OF A SPECIFIC USER -


I'm looking for a way to get the specific user's desktop path in C ++. I went to it, and got a heap of towers, but all of them (using SHGTFlinderpath) give me the current user's desktop path. Besides, I could get a list of users with NetUuserum, besides, it would be great if it works on Windows 2000 / XP, but it is not necessary. Thanks;) #include & lt; Shlobj.h & gt; # Include & lt; Stdio.h & gt; int main () {four paths [MAX_PATH]; SHGetFolderPath (zero, CSIDL_DESKTOP, zero, SHGFP_TYPE_CURRENT, path); printf (path); Return 0; }

You can retrieve the current user path through the system environment constant
RUN - & gt; CMD - & gt; Type "Set up apadata" - CMD reverbs the path of data data folder, so you can split this string by "\" and the user can get the path
I think the easiest way to do this That is, call CMD in the
C ++ and pass the "set apadata" as the parameter and get the output - then whatever you want to retrieve the current user path

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -