We’ve all had it happen. You’re running out of space on your precious C-drive and you start to madly uninstall unneeded programs. Sometimes you even resort to uninstalling programs from C:\Program Files just so you can move them to D:\Program Files. (Chris Sells mentioned doing this dance recently, which is why I’m writing this blog entry.) STOP THE INSANITY. You can save a ton of time by following these simple steps:
- Download Junction from sysinternals.com.
- On another hard drive, create a D:\Program Files or whatever you want to call the directory. The name doesn’t matter.
- Move C:\Program Files\AppThatIWantToMove to D:\Program Files\AppThatIWantToMove. Note that once you’ve done this, the program will no longer work properly (yet) because everything in your registry that makes file extensions, COM objects, etc. work is still pointing to the application at C:\Program Files\AppThatIWantToMove.
- Run the following command: junction “C:\Program Files\AppThatIWantToMove” “D:\Program Files\AppThatIWantToMove”
- Launch explorer and go to “C:\Program Files\AppThatIWantToMove”. The app appears to be on your C-drive again, but its actually stored on D-drive. Your application works just like it did before, but you’ve freed up space on your C-drive and you didn’t have to go through the uninstall/reinstall dance.
What you’ve actually done is to create a junction that says, “Windows, when someone asks for something stored in C:\Program Files\AppThatIWantToMove, everything is actually stored over there on D:\Program Files\AppThatIWantToMove.) This is completely different from the shortcuts that you’re used to. If you create a shortcut on your Desktop to a directory such as C:\Foo\Bar, when you navigate the shortcut and then up one folder, you end up at C:\Foo, not back on your Desktop. If you were to create a junction, navigate the juction, and then up one folder, you would end up back on your Desktop. It’s as if the folder actually does exist on your Desktop, but is stored elsewhere.
I use the
same technique for keeping my Virtual PC images on an external hard drive, but making them appear to be in My Documents. (I find this handy because when I need to take a VPC on the road without my external HD, I simply delete the junction, copy the contents of the folder locally, and I’m in business.)
Note that the only thing special about Junction is that it allows you to create junctions (aka symlinks). This feature is built into Windows/NTFS, but just not exposed to the end-user. You can even delete the sysinternals.com Junction application after you’ve moved your application.
If you ever feel the burning need to move the application back to your C-drive, you can just reverse the process:
- Delete the junction using: junction -d “C:\Program Files\AppThatIWantToMove”
- Move D:\Program Files\AppThatIWantToMove back to C:\Program Files\AppThatIWantToMove.
- Everything is back to the way it was, including your C-Drive being overly full again.