更改 Windows 7 中的程序文​​件默认位置

发布于 2024-10-30 14:06:16 字数 782 浏览 0 评论 0原文

各位,

当我买了一台新电脑时,我总是先将磁盘分区为 C、D 和 E,然后在 C 上安装 Windows,在 D 上安装其他软件,并使用 E 进行我自己的工作。为了使安装更容易,我首先将 ProgramFilesDir (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir) 的注册表位置更改为“D:\Program Files”。执行此操作后,所有新安装都会转到 D:\Program Files。生活过得很好。

现在我有 Windows 7。我看到注册表现在包含所有这些条目...

CommonFilesDir
CommonFilesDir (x86)
CommonW6432Dir
ProgramFilesDir
ProgramFilesDir (x86)

在安装 Windows 7 时,两个“CommonFiles”目录已经安装了一些东西。我决定不碰这些。其余的我改成他们的 D 驱动器等效项。

所以有两个问题...

首先,新软件安装仍然要转到 C:\Program Files。我总是必须将“C”更改为“D”——我以前从未这样做过。 (是的,自从更改注册表以来,我已经重新启动了很多次。)

其次,我发现 Visual Studio 2010 似乎对此特别困惑。我已经安装了.NET 4.0,甚至尝试修复它,但 VS 2010 坚持认为我没有安装 4.0。 (我听说其他人也有这个麻烦,VS 2010 似乎真的很想放在 C 驱动器上。)

亲爱的朋友,对这两个问题有什么帮助吗?

Folks,

When I get a new PC, I always first partition my disk into C, D and E - then install Windows on C, other software on D, and use E for my own work. To make my installs easier, I first change the registry location of ProgramFilesDir (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir) to "D:\Program Files". Once I do this, all new installations go to D:\Program Files. Life was good.

Now I have Windows 7. I see that the Registry includes all these entries now...

CommonFilesDir
CommonFilesDir (x86)
CommonW6432Dir
ProgramFilesDir
ProgramFilesDir (x86)

By the time Windows 7 was installed, the two "CommonFiles" directories already had stuff installed. I decided to leave these untouched. The rest I changed to their D-drive equivalents.

So two issues...

First, new software installs STILL want to go to C:\Program Files. I always have to change the "C" to a "D" - which I've never had to do before. (Yes, I've rebooted plenty since making the registry change.)

Second, I'm finding that Visual Studio 2010 seems especially confused by this. I have installed .NET 4.0, and even tried repairing it, but VS 2010 insists I don't have 4.0 installed. (I've heard that others have this trouble, too, and VS 2010 seems to really want to be on the C-drive.)

Any help, dear friends, with either issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

故事灯 2024-11-06 14:06:16

我建议您不要更改注册表以指向程序文件的新驱动器。 Microsoft 对 c:\program 文件中的许多内容进行了硬编码,如果没有此设置,一切都会崩溃。对于更新等尤其如此。

请参阅 http://support.microsoft.com/kb/933700

MS不支持更改程序文件的位置!

现实是我们每次安装某些东西时都必须明确设置“d”!

I suggest you do not change the reg to point to new drive for program files. Microsoft hard code many things to expect c:\program files and without this set=up all hell breaks loose. This especially true for updates etc.

See http://support.microsoft.com/kb/933700

MS does not support changing location of program files!

The reality is we just have to expicitly set "d" every time we go to install something!

素食主义者 2024-11-06 14:06:16

这是我想出的,我没有尝试过,因为我还没有订购我的SSD,但是大家
应该尝试这个。两个简单的部分,每个部分只需几个步骤。

第 1 部分

A)

开始 >控制面板>系统>高级系统选项(Win XP?/Vista/7/8)

弹出窗口>转到:高级选项卡,位于顶部 >环境变量,位于右下角。

底部窗口区域标记为:系统路径>新按钮

变量名称:CSIDL_PROGRAM_FILES

变量值:X:\Program Files\

用您的驱动器号替换 X,并记住使用 \ 反斜杠,而不是正斜杠 /

如果您有一个简单的 32 位(x86 平台),这就是结束个人电脑。

对于 B 部分,这是我们 64 位平台 PC 用户必须执行此额外步骤的地方。
对于 x64,该变量充当标准的静态程序结构,但通过注册表分隔符兼容 WoW64。
因此,我们要做的只是添加一个附加变量,并为每个新值稍微更改名称。

B)

底部窗口区域标记为:系统路径>新按钮

变量名称:CSIDL_PROGRAM_FILESX86

变量值:X:\Program Files (x86)\

这设置了我们的新环境中仍然存在的 32 位平台程序,
因为迄今为止大多数程序都不需要使用更多线程,并且它们就是这样构建的。

第 2 部分

更改默认程序文件安装的注册表项的标准。

开始>运行>输入“regedit”按 Enter 键。
在左侧树上导航到: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

更改出现在右侧框架上的两个值,就像我们之前所做的那样。 x86平台只需要一个,
如果您没有 64 位,则无需更改第二个值。

A)

变量名称:ProgramFilesDir

变量值:X:\Program Files

B)(如果您有 64 位 Windows)

变量名称:ProgramFilesDir (x86)

变量值:X :\Program Files (x86)

旁注,请注意此变量集没有附加的向后“\”
在它上面,因为它不能包含在这个特定的部分中,我还不知道为什么啊哈哈哈,
但我只会遵循之前的格式

Here is what I came up with, I haven't tried it as I have not ordered my SSD, but everyone
should try this. Two easy Parts, Just a few steps each.

Part 1

A)

Start > Control Panel > System > Advanced System Options(Win XP?/Vista/7/8)

Pop-Up window > Go to: Advanced Tab, at Top > Environment Variables, at bottom right.

Bottom window area Marked: System Path > New Button

Variable Name: CSIDL_PROGRAM_FILES

Variable Value: X:\Program Files\

Replacing X with your drive letter, and remembering to use \ back slash, not forward slash /

This is the end if you have a simple 32-Bit(x86 platformed) PC.

For part B, This is where we 64-Bit platformed PC-goers have to do this additional step.
for x64 the variable acts as the standard still program structure, but WoW64 compliant via registry separator.
So what we have to do is just an additional variable, with a slight change of the Name for each new values.

B)

Bottom window area Marked: System Path > New Button

Variable Name: CSIDL_PROGRAM_FILESX86

Variable Value: X:\Program Files (x86)\

This sets our 32-Bit Platformed programs which still exist in our new environment,
as most programs do not need to use to this day more threads, and they are built that way.

Part 2

The standard changing your registry keys for default program files installs.

Start > Run > enter "regedit" Hit Enter.
Navigate on left tree to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

change two values that appear on right frame, as we did before. Only one is needed for x86 Platform,
If you do not own 64-bit, You need not change the second value.

A)

Variable Name: ProgramFilesDir

Variable Value: X:\Program Files

B) (If you have 64-Bit windows)

Variable Name: ProgramFilesDir (x86)

Variable Value: X:\Program Files (x86)

Side note, Notice this variable set does not have an additional backwards "\"
on it, as it can't have in it in this particular section, I do not know why as of yet ahahahah,
but I would just follow prior formatting of how it was.

如何使用 GimmiLFactorY 建议,然后添加到程序文件夹的硬链接,或者更确切地说,使用目录连接。以下文章展示了如何轻松完成此操作:

http://ipggi.wordpress.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/

How about using GimmiLFactorY suggestion and then adding a hard link to the program folders, or rather, use a directory junction. The following article shows how you can do this easily:

http://ipggi.wordpress.com/2009/09/07/windows-file-junctions-symbolic-links-and-hard-links/

狂之美人 2024-11-06 14:06:16

64 位版本有两个版本的 regedit。也进行此更改:

1.) 输入开始 > 运行:%systemroot%\syswow64\regedit

2.) 转到:HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion code>

3.) 将 DWORDs ProgramFilesDir、ProgramFilesDir (x86) 中的路径更改为新路径,可能只是更改驱动器号。

The 64bit version has two versions of regedit. Make this change as well:

1.) Enter into Start >Run: %systemroot%\syswow64\regedit

2.) Go to: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion

3.) Change the Path in DWORDs ProgramFilesDir, ProgramFilesDir (x86) to the new path, probably just changing the drive letter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文