Moving user accounts on Windows XP
As I recently posted – my Windows XP machine at home was infected with Antivir Solutions – an “antivirus” program that infects you with itself and then tries to get you to pay to remove it. That was three hours down the toilet.
.
Yesterday my family informed me that the computer had been horribly slow lately so I started digging into things. I did all the usual – looking for extra services, removed extra programs, did some XP tuneup things that I found on the net and finally got to defragging the computer. “Defragging” is something that any experienced Windows user knows about but is virtually unheard of in Unix/Linux because their filesystems don’t suck. As your disk starts getting full, there is no one spot on disk large enough to add a large file so filesystem stores pieces of the file throughout the disk – this makes accessing the file slow. It also slows down other things that are waiting in line to access the disk. I had to go through some gyrations freeing up space because my main C: disk was nearly full.
.
The computer is a Sony Vaio that we’ve had for probably 8 years. The thing came with a 70-80GB drive that was split up(partitioned) into 13GB C: drive and 64GB D: drive. As you may or may not know, when you create user accounts on Windows, it puts them in C:\Documents and Settings\UserName. Every file you download or application you run leaves things inside this directory. When you start getting involved in graphics and movies these directories can become huge and I have been battling a space shortage on C: for years. Dear Sony – I hate you. This insane artificial limitation on where user directories can be on Windows drives a Unix guy like me crazy. On Unix, user directories can be anywhere on the machine or network and can be moved at will. So – I decided that I would find a way to move my user directories off of C: or die trying. I learned a few things along the way that some of you might find interesting.
.
First off – I’m talking about home computers running Windows XP – not networked computers like you might have at work that have profiles and such. After googling around, I found a couple of solutions – all of which had problems. When initially installing Windows, you can create some sort of file that will make it put user directories wherever you say – not an option for me since my computer is already installed. This still doesn’t mean you can put then anywhere – just that you can put them somewhere other than C:. Various people reported that you could get into some ugly hacking of the registry to get the directories elswhere – which looked dangerous and difficult. A coworker had a good suggestion – if I had another disk, you could make that partition appear as a folder anywhere in C: – say replacing C:\Documents and Settings with another drive. I wanted to use H:\Users as my user directory storage not H: – so I didn’t like that idea even though I probably could have made it work.
.
So my solution was to use the Windows equivalent of a symbolic link. SymLinks are a very handy construct that have existed since time immemorial on Unix. The are a pointer to another location that might exist anywhere on the machine or network. They look feel and act like regular files and directories but just point to somewhere else. Windows only recently had something similar called “junctions” and in typical Microsoft fashion, they have to take something logical and known and give it their own stupid name – like calling directories “folders” or replacing the defacto directory separator – the slash / – and changing it to be the hard-to-reach backslash \. Junctions first came into being in Windows 2000 probably 30 years after Unix had links and are far less capable. A Windows junction can only point to a local file or directoy – not a location on the network. It was not until Windows Vista in 2006 that Microsoft released a real symbolic link that could point to networked locations. But I have Windows XP and was stuck with junction points.
.
So my plan in case it isn’t obvious yet was to copy the user directories from C:\Documents and Settings to H:\Users. I am neither a “Document” or a “Setting”. Then I would create a junction point in “Documents and Settings” pointing to the new location on my H: drive. First I acquired junction.exe because obviously Microsoft couldn’t include something in the operating system that was actually useful. Then I used xcopy to copy the directories, renamed the original dirs, and set the link with junction. Here are the actual commands:
xcopy mjb H:\Users\mjb /O /X /E /H /K /C
rename mjb mjb.orig
junction "C:\Documents and Settings\mjb" H:\Users\mjb
I like this solution over the alternatives – junctions allow me to move any dirctory on my system to another location while maintaining the original path.
.
While I was doing all this work, I installed a couple of programs to make Windows more useful and bearable. Curiously I find that Windows becomes more useable as you install more non-Microsoft software. First up was KpyM Telnet/SSH Server. This allows my to login to my XP machine from another computer – this just gives me a simple command line. I already have VNC that give me the whole desktop on a remote machine.
.
After that I installed Console2. The windows command line interface cmd is total crap (Start-Run-cmd). It can’t be resized which never fails to infuriate me. Console2 is more like the terminals on Unix/Linux and include tabs.
.
So there you go – my space issues are solved, I installed a couple of useful tools on my Windows machine, and I learned a nifty trick with junctions. Enjoy. If you want to really really really piss me – supply me a solution to moving user accounts that is easier – my solution took me quite a while to figure out.
Bumpkin,
Would you consider teaching a class for people who want to learn more about Unix? Or more to the point, people who would consider migrating from Windows to one of the Unix products you mentioned in one of your posts?
Just a thought….
although not 100% of what you have accomplished but from the start menu or a desktop shortcut you could right click on your my documents folder and select Properties then select Move this will allow you to relocate your documents folder and all of the space hogging files and settings
- John
@John The problem wasn’t with documents or any of that stuff – which I can save anywhere I want. It was more stuff in C:\Documents and Settings\mjb\Local Settings\Application Data. For instance there was a thumbnail DB in Picasa that was about 500M. The Google Earth cache was gigantic and there were lots of other things as well. All this multiplied by the 4 active users in the house was really squeezing me on C:
@bumpkin
Got it, I agree this is a down fall of Windows in a non domain environment and even that can be lacking. Someone @Sony Corp should have their head examined for that set up I never understood the logic in that, it’s a common problem.
So I guess to restate what I did and why in the simplest terms: I moved everything related to my windows account to a location with sufficient spacing in a way that maintained the original path/location
@When will they learn
I think you would find that if you were plunked down in front of a Linux computer you would have no difficulty using it.
I think a class would be overkill. I would gladly meet up with anyone and help them identify and install applications on their Windows computers that also work on Linux. Then once you’re happy that you’ll be able to do your daily work, I could help installing Linux after first making sure that your peripherals(printers and such) work.
Maybe a post specifically devoted to programs that will run on Windows and Linux would be a good place to start.
Also I would generally say that no one should be intimidated by Linux – it’s just not difficult to use and many things (like software updates) are far easier and superior to anything on Windows.
Bumpkin,
There is a great product called “Partition Magic” that allows you to resize your hard drive partitions on the fly. You could have taken space from D: and given it to C: — have done this numerous times on Sony factory setups to correct this problem.
JR
(Bolshoi Bob’s “older” little brother)
@Miracle John
You are right – Partition Magic would have done the trick as well. I just went looking to price it out and it looks like it’s been discontinued.
Bumpkin,
You could also try Partition Manager by Paragon. The current version is version 11. Also supports other operating systems like Unix/Linux.
http://www.partition-manager.com/
JR
Yo bumpkin,
Enjoy the site and the column, good info all around. Used to work with you, live in Middleboro.
Mark