Link to home
Start Free TrialLog in
Avatar of sprinkmeier
sprinkmeier

asked on

mounting "c:\program files" on a different partition

I want to mount "c:\program files" as a seperate partition. What I'd like to do is:

create the other partition
copy "c:\program files" into it
delete "c:\program files\*"
mount the other partition as "c:\program files" using the Computer Management tool.

Now programs think they're in the default location (which keeps them happy) without messing with the OS partition (which keeps me happy).

Problem is by the time everything's running the directory is locked (I think IE/Explorer is using it).

Anyone know how to get around this?

(while I'm at it, I'd like to move "c:\doc&settings" as well....)
ASKER CERTIFIED SOLUTION
Avatar of Idem
Idem

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MSGeek
MSGeek

Sounds like you are trying to free space on the C: drive, is that correct?  You cannot just move existing installed programs or the documents and settings folder.  There is a way to map a directory to a volume on a seeprate physical disk or partition and have the OS still think it's on the same drive.  Please clarify.
You CAN change your default "Program Files" and "Documents and Settings" Registry entries, but for ALREADY INSTALLED software, it will be more tricky.  Many programs reference the environment variables, but many do not.  you will have to edit every direct reference to c:\program files & c:\progra~1 to match your new configuration.

The default locations for those settings are:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
-AND are referenced by the vaules at:-
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

The value names are pretty obvious.  What is NOT obvoius is that they are of REG_EXPAND_SZ type, which cannot be edited by Windows 2000's REGEDIT.exe, but can by REGEDT32.exe (this was FINALLY fixed in Windows XP, ref my article @ http://www.ntfaq.com/Articles/Index.cfm?ArticleID=14738).

You should use REGEDT32 if you are going to edit these values.  
You should then move the directories
and then you should use REGEDIT to search for and correct any references to "C:\Program Files" AND "C:\progra~1"


HOWEVER, it is important to note that an FDISK may be less painful, as FDISK fixes everything.

-HTH
-Steven Yarnot
http://yarnosg.home.insightbb.com
Oh, and lets not forget those pesky .INI files that far too many sofware developers still use; hunt for those and correct their references too.

The Backup/FDISK/Rebuild/Restore option is looking better all the time...

-Steve
Avatar of sprinkmeier

ASKER

Idem, much as I like LINUX I'd rather not use it to mess with NTFS partitions. Idea is good, though. No reason why I can't put on a temporary second windos partition and use that.

MSGeek, I'm trying to seperate OS, apps and data into seperate partitions (<flamebait> it's one of those 'relaibility and stability' things, no wonder windos doesn't like it :-)

VarnoSG, I know about changing the fedault, but I also know that some programs are too braindead to check what the default it, so I'd rather keep stuff in c:\...... Also, I don't want to have c:\prog /AND/ d:\prog.

I was hoping there was something like single-user mode in UN*X (safe mode locks stuff too).

I guess worst case is moving as much as I can, copying the rest and then do the mnounting. There'd be a few 'hidden' files left on the C partition, but that's life.
Other than using a second windos partition rather than a LINUX one I think this is the best way.

Thanks.
I just tried to do the same thing, and I think I've found a procedure that works:

1.  Have the desired partition already mounted under some drive letter, assuming D: here

2.  Boot into "Safe Mode with Command Prompt".  This won't load IE, which is curious given Bill's assertion that IE can't be separated from the OS...

3.  go to C:\ and type 'cd progra~1'.  Make sure this sends you to "Program Files".  If it doesn't, figure out what DOS 8.3 pathname sends you to "Program Files".  Make a note of it.

4.  rename "Program Files" to "oldProgFiles".  The new name MUST be different in the first 8 characters.  This is to make sure the DOS 8.3 pathname will also be changed.

5.  make the new directory: 'mkdir "Program Files"'.

6.  type 'cd progra~1', or whatever DOS 8.3 pathname you found in step 4.  Make sure it sends you to the new directory you just created.  If not, remove the directory.  Make some dummy directories as needed, then create the real one.  One way or another get the correct DOS 8.3 pathname to be associated with the new "Program Files" directory you are trying to make.

7.  type 'mountvol'.  Read the list and find the VolumeID for the desired partition.  This is why you need it to be mounted somewhere already.

8. type 'mountvol "C:\Program Files" <VolumeID>'  VolumeID starts with \\?\, its not just the numbers inside the braces.

9. xcopy everything from oldProgFiles to "Program Files" using /S /E /V options.  I had an "access denied" error doing this, somehow resolved it by going to D: (which is mapped to the same partition), then typing
      xcopy C:\oldProgFiles\*.* .\*.* /S /E
my only guess is the longer destination pathname of "C:\Program Files\*.*" got too long for xcopy to handle it.  (?)  I didn't use /V but I should have.

10. 'exit' from the prompt and reboot.  It seemed to freeze on me when I did this (must not have liked me putting the prompt in full screen).  just use ctrl-alt-del->shutdown if that happens.

11. deny access to Everyone on "oldProgFiles", as an extra way to make sure it isn't getting used.

12. keep the old folder around and watch the log for a while, and test out your programs that were installed under program files.
----------------

Note that we're mounting the partition so that it inherits the same DOS 8.3 pathname as well as the full name.  If the DOS 8.3 name ends up different, some programs will have issues.  I have a problem with Symantec Antivirus right now because I didn't think about the 8.3 pathname issue when I did this.
nice one dementg!

happy to give you points if you want them, looks to me you earned them ;-)
Unless they're burning a hole in your pocket, then don't worry about it.  I'm not sure I'd end up using them, I'm not really an active user of this site (at least not yet).  I had some trouble finding any info about this topic, so once I figured it out I was just anxious to post something about it.

It would sure be nice if microsoft would let you set up mount points during the install phase, like all the real OS's do.