Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

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....)
0
sprinkmeier
Asked:
sprinkmeier
  • 3
  • 2
  • 2
  • +2
1 Solution
 
IdemCommented:
I think the only way i can think of doing this is using a linux resque disk boot with it, mount the windows partition this will allow u to copy / move the partition without windows locking anything, then happily move the DIR to the second partition (after mounting it ) and that should do it.
OR you could copy the folder into another DIR and then boot in WIN2K and then move it to the new partition after which point all programs to access it from the new partition, then delete the old Folder.
Hope it helps.
Thanks
Medi
0
 
MSGeekCommented:
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.
0
 
YarnoSGCommented:
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
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
YarnoSGCommented:
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
0
 
sprinkmeierAuthor Commented:
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.
0
 
sprinkmeierAuthor Commented:
Other than using a second windos partition rather than a LINUX one I think this is the best way.

Thanks.
0
 
dementgCommented:
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.
0
 
sprinkmeierAuthor Commented:
nice one dementg!

happy to give you points if you want them, looks to me you earned them ;-)
0
 
dementgCommented:
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.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now