I'm logged in via Remote Desktop Connection as a domain user on a Windows Server 2019 (OS Build 17763.1432).
I tried to install an .exe file but directly getting the error: "0x8007010b - GetTempFileNameW: The directory name is invalid."
Running the .exe as administrator doesn't help. The .exe is also not blocked (file properties).
In cmd I typed echo %TMP%
and the output was:
C:\Users\.<removed>.\AppData\Local\Temp\2
when browsing to that folder, I saw that only ..Local\Temp\
exists but not the subdirectory \2
(= the session id).
(see: https://devblogs.microsoft.com/oldnewthing/20110125-00/?p=11673 )
QUESTION:
Why does echo %TMP%
show my temporary folder + session id, but the folder itself doesn't exist. Is this on purpose?
(trying to figure out how to get the .exe installer working without having to manually adding folders with the current correct session id number...)
Did you see this support article: https://docs.winking.be/tn/article/207
Solutions: They suggest two "solutions":
Group Policy: Run
gpedit.msc
to open the Local Group Policy Editor. Changing policies on a server might be a bit extreme in some environments... Depends how much autonomy you have. I would check with the lords.Windows Server 2003+: Computer Configuration\Administrative Templates\Windows Components\Terminal Services\Temporary folders
Windows Server 2019+: Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Temporary folders
Raymond Chen: Why does the name of my TEMP directory keep changing?
Links: Some further links that are "nice to have". Do visit the first one: