I am writting a program that needs to access files in MyDocuments folder of the user running the program. I am aware of GetUserName() but the program is being run as a service and so GetUserName() returns SYSTEM. Could anybody help me with how to get a list of all users are logged in.

What OS?
Version?
What Compiler?

For use with windows xp and 2000. I am compiling it with Visual Studio 6.0.

you could use WMI i think

i would access the windows registry and get the username

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.