When trying to install an application on Windows/Windows Server by clicking the setup executable (e.g. setup.exe) you receive an Installer error:
0x8007010b - GetTempFileNameW: The directory name is invalid.
Most likely you are logged in remotely to the Windows (Server) desktop via a Remote Desktop Connection .
When connecting to a Windows (Server) desktop via Remote Desktop, a subdirectory with a Session ID is added to the temporary folder path. This subdirectory doesn't exist and causes the executable to fail with the message
0x8007010b - GetTempFileNameW: The directory name is invalid. .
- Find out what your current temporary folder path is by opening commandprompt and typing:
A possible output could be:
Notice the number 2 at the end of the path. This is your Session ID.
- Navigate to the folder:
- Create the missing folder. (In our case the folder was called: "
- Try to run the executable installer again. If all went fine the installation should work.
gpedit.mscto open the Local Group Policy Editor.
- Navigate to:
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
- Enable the policy
Do not use temporary folders per session.to disable the creation of temporary Session ID folders.
- Optionally you could also check the policy
Restrict Remote Desktop Services users to a single Remote Desktop Services sessionin the
Remote Desktop Session Host\Connectionssection.