Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if the currently logged on user is using roaming profile?

How can I check if the current user is using roaming profile?

Is there any .net framework library that can help?

like image 412
gneash Avatar asked Feb 01 '26 10:02

gneash


1 Answers

I believe the only way to do this is to call the Win32 shell function GetProfileType. You would need to use P/Invoke to make the call and then check the out value of the pdwFlags parameter for PT_ROAMING (which has the value of 2).

I don't see a sample signature for this function on pinvoke.net but with such a simple signature:

BOOL WINAPI GetProfileType(      
    DWORD *pdwFlags
);

Creating one would not be hard.

like image 148
Robert Horvick Avatar answered Feb 02 '26 23:02

Robert Horvick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!