<code>file normalize ~$::tcl_platform(user)</code>

returns:

  - in tclsh86tg, normal user :   user doesn't exist

  - in tclsh86tg run as Admin :

The computer is a Win 7 machine connected to a domain controller with an active directory.

This problem was first detected with Tk test suite test winDialog-5.12.2].

Looking at the code and debugging:

looks at the <code>NetUserGetInfo</code> in <code>TclpGetUserHome</code> in tclWinFile.c
In the described situation this call returns 2221 (NERR_UserNotFound).

The following patch fixes the issue for me:
<verbatim>
Index: win/tclWinFile.c
==================================================================
--- win/tclWinFile.c
+++ win/tclWinFile.c
@@ -1442,10 +1442,11 @@
     int nameLen = -1;
     int badDomain = 0;
     char *domain;
     WCHAR *wName, *wHomeDir, *wDomain, **wDomainPtr = &wDomain;
     WCHAR buf[MAX_PATH];
+    LPCWSTR wServername = NULL;

     Tcl_DStringInit(bufferPtr);
     wDomain = NULL;
     domain = strchr(name, '@');
     if (domain != NULL) {
@@ -1456,11 +1457,12 @@
        nameLen = domain - name;
     }
     if (badDomain == 0) {
        Tcl_DStringInit(&ds);
        wName = Tcl_UtfToUniCharDString(name, nameLen, &ds);
-       if (NetUserGetInfo(wDomain, wName, 1, (LPBYTE *) uiPtrPtr) == 0) {
+        NetGetDCName(NULL, wDomain, (LPBYTE *) &wServername);
+       if (NetUserGetInfo(wServername, wName, 1, (LPBYTE *) uiPtrPtr) == 0) {
            wHomeDir = uiPtr->usri1_home_dir;
            if ((wHomeDir != NULL) && (wHomeDir[0] != L'\0')) {
                Tcl_UniCharToUtfDString(wHomeDir, lstrlenW(wHomeDir),
                        bufferPtr);
            } else {
</verbatim>