I had been using
to identify which system was running on in a compiled app and all seemed fine.
The college machine was/is Win10 while personal was still Win7 -- just got new box for home as had hardware failure on older; this one is also Win10 Pro, but now the above returns an empty string.
The truly puzzling part is from MATLAB if I execute
and, indeed, USERDOMAIN is apparently not set in the environment.
But, if I open CMD.EXE and type SET there, then the result is
Microsoft Windows [Version 10.0.19042.685]
(c) 2020 Microsoft Corporation. All rights reserved.
then USERDOMAIN does, in fact, exst.
Can anybody explain why the behavior that while running inside MATLAB can't see the USERDOMAIN environment variable or better yet, how to have it be visible?