Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Why does TCC wait when I run ...

May
15,047
271
... "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.20211.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"

It is a subsystem GUI app.
 
I reckon it's because TCC can't determine the EXE type. Apparently CMD can; CMD doesn't wait.

Code:
d:\tc24> echo %@exetype[d:\wt21\WindowsTerminal.exe]
9

d:\tc24> echo %@exetype["C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.20211.0_x64__8wekyb3d8bbwe\WindowsTerminal.
exe"]
0

Is that a permissions thing? Note that I can use DUMPBIN on that file, and open it in my hex editor.
 
ExecWait=No. I am elevated.

Code:
v:\> echo %_elevated %@exetype["C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.20211.0_x64__8wekyb3d8bbwe\WindowsTe
rminal.exe"]
1 0

If I copy the file, @EXETYPE works.

Code:
v:\> copy "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.20211.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.23.20211.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe => V:\WindowsTerminal.exe
     1 file copied

v:\> echo %@exetype["WindowsTerminal.exe"]
9
 
I'll test that. But, as I said, I can open it in a hex editor, even TYPE /X it.
 
Does this code look OK?

Code:
    DWORD dwType;
    wprintf(L"%d\r\n",
        GetBinaryTypeW(L"C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.23.20211.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe", &dwType)
    );
    wprintf(L"type = %lu\n", dwType);
    return 0;

If it is OK, then GetBinaryType is failing.
 
What's really strange is that the same code used on my copy of the EXE gives 6 (Win32 GUI). DUMPBIN says 8664 machine (x64).
 
Does this code look OK?

Code:
    DWORD dwType;
    wprintf(L"%d\r\n",
        GetBinaryTypeW(L"C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.23.20211.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe", &dwType)
    );
    wprintf(L"type = %lu\n", dwType);
    return 0;

If it is OK, then GetBinaryType is failing.

You should be testing the return code from GetBinaryTypeW; if it succeeds it'll be 1, if it fails 0. You can then call GetLastError to see why it failed.
 
Is it a Windows Store app? I've seen this error when calling GetBinaryType() on Windows Store apps; no idea why. (You can use SHGetFileInfoW() as a workaround.)
 
Back
Top