December 24, 2008

Windows XP Setup from DOS ("cannot find file")

I had a strange issue today, a blast from the past in fact—trying to install Windows from DOS. Strange situation, I am basically about to replace my parents computer and wanted to re-install Windows on the old computer so I could give it away whilst still being ‘usable’.

Back in the day I made a Ghost image of the computer with a freshly installed Windows XP installation (with SP1 at the time maybe and drivers??) however on restoration of image I get an error message three-quarters of the way through saying something about unexpected end of file. Whatever it was it was annoying. Unfortunately the Windows XP disc is far away (in another country in fact) and the only thing I have is couple of DOS boot disks and the I386 directory (containing installation files) that I rescued before I started this procedure.

So I burnt the I386 directory to a blank CD (from my work laptop) and booted up with the DOS boot disk (basically a boot disk made from either one of the later Windows 95 versions or Windows 98. Whatever, it supported FAT32). Now with my hard disk formatted I tried to run setup (WINNT.EXE) from the CD, but unfortunately I ran into issues; the set-up program complained that it couldn’t find files such "disk1" or "hal.dll".

A quick search on the net brought nothing. So I tried a few more combinations such as copying files to the hard disk and re-running setup. Again, to no avail.

I then re-ran setup and noticed that it read a file called DOSNET.INF. According to a Microsoft TechNet article here, DOSNET.INF contains a list of files to copy that are needed for setup. Back on my work computer I opened the file and noticed an interesting entry under the Directories section. Mine said "d1 = \I386". Further down the file you’ll notice "d1" is mentioned against every file.

[Directories]
d1 = \I386

....

[FloppyFiles.0]
d1,disk1,disk101
d1,ntdetect.com

This didn't seem right so I modified DOSNET.INF so that it read "d1 = \". Personally instead of re-writing another CD with a modified DOSNET.INF file, I copied the I386 files to the hard disk and modified DOSNET.INF there. This worked but as I didn't copy the sub directories set up complained much later on that it couldn’t find ASMS (which one of the subdirectories is named after), but I shoved the CD back in and it worked.