5

I'm not sure if this is possible, but I'm hoping you guys will know one way or the other!

I'm going to be reinstalling windows xp, and the primary master IDE is a smaller 10 gig drive.

I'm pretty sure that if I tried to install all my programs back onto the C:\ drive that they'd not all fit.

Is it possible to get my Program Files directory to point to a partition on one of my larger drives, so I don't end up with some of my programs on C:\ and others on D:\, E:\, etc?

Kara Marfia
  • 7,892
  • 5
  • 33
  • 57

5 Answers5

6

If you would prefer to set those folders during install, you will have to use an attended installation. UNATTEND.TXT is an INI file that contains the unattended setup settings for Windows XP. Specifically to set system folders to non-default locations, you would add this into your UNATTEND.TXT:

[Unattended]
CommonProgramFilesDir="D:\Programs\Common Files"
ProgramFilesDir=D:\Programs
TargetPath=\WINDOWS

[GuiUnattended]
ProfilesDir=C:\Users

This site is a great references for creating an unattend installation of Windows XP: unattended.msfn.org/unattended.xp/

More reference material can be found in the Windows XP Deployment Tools from the Microsoft Downloads site microsoft.com/downloads

Aaron Parker
  • 116
  • 4
  • 1
    I think that you've got your CommonProgramFilesDir and ProgramFilesDir switched around. Great answer, though--this is the right answer for someone that is going to reinstall. – Jay Michaud Jun 03 '09 at 01:49
4

The way people typically accomplish this is to use a symlink. The process is something along the lines of:

  • create a bootable windows live CD (bart PE or similar) with the Sysinternals Junction utility on it: http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
  • boot onto the CD
  • move your program files directory from C:\ to wherever you want it
  • create a symlink from C:\Program Files to the new location
  • reboot into windows and everything should be good
MattB
  • 11,194
  • 1
  • 30
  • 36
3

I've done exactly this (in my case, move "Program Files" to D:\Program Files) a couple of times. It gets tricky, but can be done. Off the top of my head:

  1. Use NTBackup to take a backup of your Program Files directory
  2. Restore that backup on the partition-of-choice (D:\Program Files, say)
  3. Go into the registry and change [HKLM\Software\Microsoft\Windows\CurrentVersion]:ProgramFilesDir and CommonFilesDir to reflect the new location.
  4. Reboot
  5. Ensure everything is working right
  6. Use a tool like psexec to check if any process has open files in C:\Program Files, stop the process or close them.
  7. Rename the old Program Files to something else.
  8. use linkd to create a symlink of D:\Program Files on C:\Program files in order to accommodate programs that use "C:\Program Files" instead of "%Program Files%" in their stored file paths.

The alternate method is a bit easier...

  1. Use NTBackup to take a backup of your Program Files directory
  2. Restore that backup on the partition-of-choice (D:)
  3. Create a new directory C:\Program Files2
  4. Use Disk Manager to multi-mount D:\ to C:\Program Files2
  5. Shut all programs down you can find
  6. Attempt to rename Program Files to something else
  7. Rename Program Files2 to Program Files
  8. Reboot

I've only ever tried this on a freshly installed system. I haven't done it on a system with a year's worth of cruft. I'm uncertain it would work then.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
1

This largely depends on the application you are installing. If it allows you to choose another install location then it should work from another folder (or drive, in your case). However, if the installer doesn't ask for an install path, there might be some references to the Program Files folder in the registry keys the program creates, or worse: hardcoded.

I would probably try it one app at a time. If some do not work from another drive then you'll likely have to install to C:\Program Files\

Note: You could also accomplish this more cleanly in Vista / Windows 7 using symbolic links.

EDIT: I just found this link, but I have never done this... try at your own risk:

Click Start -> Run (or Windows key + R) Type regedit and click OK.

Scroll to the key: HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion

On the right window, double click on the key ProgramFilesDir and modify data in this key by the new path for the installation folder.

For example, enter the path D: \ Program Files, to change the partition on which the facilities are.

Andy May
  • 919
  • 11
  • 16
0

Having ProgramFiles on anyplace other than the system drive is not supported.

For that matter neither is relocating of the Users folder; although you can specify a different location at install time through the unattend.xml file:

Stephen Lodwick [MSFT] on Tuesday, January 13, 2009 11:59 PM said:

Relocation of the "Program Files" directory is not supported in Windows Vista/7. This feature is not currently planned.

Relocation of the "Users" folder is supported through unattend.xml ("ProfilesDirectory" setting).

Why is "Program Files" redirection not supported while "Users" is? It's not just meant to be frustrating. :) We encountered a number of technical hurdles with servicing components when they were in redirected locations. We felt that without significat design changes, Setup would not be able to redirect folders without cause data loss scenarios and unservicable images.

Thank you for the feedback!

Stephen Lodwick [MSFT]

Ian Boyd
  • 5,293
  • 14
  • 60
  • 82