为什么 %TEMP% 解析为 %TEMP\<digit> 形式的非确定性路径? [英] Why does %TEMP% resolve to a non-deterministic path of the form %TEMP\&lt;digit&gt;?

查看:30
本文介绍了为什么 %TEMP% 解析为 %TEMP\<digit> 形式的非确定性路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Windows Server 2008 32 位,当我输入 %temp% 时,它会将我带到 ..AppData\Local\Temp\1\ 或 ..AppData\Local\Temp\2 而不是 ..AppData\本地\温度

I have a Windows Server 2008 32 bit and when I'm typing %temp% it takes me to ..AppData\Local\Temp\1\ or ..AppData\Local\Temp\2 instead of ..AppData\Local\Temp

我已经检查了环境变量,它们没问题.

I've already checked the Environment Variables and they are ok.

我之所以这么问是因为我有一个应用程序应该将文件复制到 %temp%\my application,而是将文件复制到 %temp%\1\my application

I'm asking that because I have an application that's supposed to copy files to %temp%\my application and instead it copies the files to %temp%\1\my application

有人有解决方案吗?

推荐答案

说明、讨论、解决方法等,均在 Old New Thing 文章 为什么我的 TEMP 目录的名称不断变化 - 它确保同一用户的多个终端服务会话不会(默认情况下)) 共享一个临时目录.

Explanation, discussion, workarounds, etc, all under the Old New Thing article Why does the name of my TEMP directory keep changing - it ensures multiple terminal services sessions for the same user don't (by default) share a temp directory.

问题出在 Administrative Templates\Windows Components\Terminal Services\Temporary folders 组策略.如果您不选择不为每个会话使用临时文件夹,则会创建这些 TEMP 子目录.还有知识库文章描述了这些组策略背后的注册表项.

The problem lay in the Administrative Templates\Windows Components\Terminal Services\Temporary folders group policy. If you don't select Do not use temporary folders per session, then these TEMP subdirectories are created. There is also a knowledge base article describing the registry keys behind these group policies.

就我个人而言,我发现回复中的第一条评论最有用:

Personally, I find the first comment in reply to be the most useful:

无论如何,临时位置跳来跳去有什么关系,这是暂时的!

Why does it matter if the temp location jumps around anyway, it's temporary!

另见

  • 为每个会话使用单独的临时文件夹
  • 这篇关于为什么 %TEMP% 解析为 %TEMP\<digit> 形式的非确定性路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆