3

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...)

juFo
  • 423
  • 3
  • 11
  • 22

1 Answers1

1

Did you see this support article: https://docs.winking.be/tn/article/207

Solutions: They suggest two "solutions":

  1. Manually creating the missing session ID folder
  2. Disable the creation of temporary Session ID folders via group policy

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:

Stein Åsmul
  • 2,616
  • 6
  • 26
  • 38
  • thanks, but I would like to know why the folder doesn't exist while it was showing in the "ECHO". – juFo Oct 15 '20 at 13:02
  • What are the policy settings on that box for the temporary folders? Maybe have a look at [this seemingly obsolete answer](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc759190(v=ws.10)). Maybe you can verify the settings from both group policy and that Terminal Services Configuration interface. As you understand I don't have access to a test environment right now. – Stein Åsmul Oct 16 '20 at 11:27
  • Do you know what type of **`setup.exe`** that is? Is it perhaps a WiX Burn bundle setup.exe? You can decompile those by installing [the WiX toolkit](https://wixtoolset.org/releases/) and then running this command from a command prompt (add full path to dark.exe if need be): `dark.exe -x outputfolder setup.exe`. Or maybe thet setup.exe was built using Installshield, Advanced Installer or some other tool? Microsoft themselves? Does it say on launch? (Installshield dialogs, etc...). – Stein Åsmul Oct 16 '20 at 11:30
  • 1
    [This answer on the Advanced Installer forum looks interesting](https://www.advancedinstaller.com/forums/viewtopic.php?t=34856#p96469). Recommended read for the man with the test box :-). – Stein Åsmul Oct 16 '20 at 11:37
  • Thanks, I guess the policy is the way to go :) – juFo Oct 16 '20 at 11:55
  • Yes, I think I will run this by some MSI-guys. We will see if there are better options. – Stein Åsmul Oct 16 '20 at 12:02