Thursday, September 11, 2014

Boot CD Won't Boot After Motherboard Change

Problem with Boot CD After Changing Motherboard

The scenario:

You created a boot CD previously to help you recover in case of computer problems.  Your computer motherboard breaks down and is replaced.  You want to reinstall your old hard drive but it is giving you problems so you take out your boot CD that you created just for such a situation and are flummoxed when even your boot CD won't boot and instead you get a blue screen error message or a computer restart. Even if you can get Windows to load into RAM and allow you to access the desktop you might find expected shortcuts to be missing or hard drives and expected programs inaccessible.

There may be other reasons but one common explanation for this behavior is that in newer motherboards the BIOS is set to run the SATA controller in AHCI mode.  This is fine if your operating system is Windows 7 or newer.  However, if the operating system you wish to run is Windows XP or based on it such as a Windows PE or BartPE  run from a boot CD the boot will likely fail unless the boot CD also includes AHCI drivers and possibly other mass storage drivers.  The easiest way to deal with this at least short term is to change the SATA settings in BIOS from AHCI mode to IDE mode.

Conversely if you are trying to boot to a Windows 7 environment and are failing to do so check the BIOS SATA settings to make sure it is in AHCI mode and not IDE mode.

Now that you have entered the Bart pre-install environment with access to hard drives you can use driver injections that you have included on your BartPE CD to load drivers or reset drivers to generic default on the Windows installation on blue screening or restarting hard drive to increase the chances they will also boot.  

Saturday, September 6, 2014

How to Boot BartPE Windows XP to RAM Drive

Booting BartPE CD to RAM Instructions

1. Have a copy of Windows XP installation CD or its files on hand.

2. Download PE Builder 3.1.10a and install. PE Builder was built with Windows XP in mind.  If you are installing PE Builder on a later Windows setup such as Windows 7, setupapi.dll from Windows XP needs to be copied to the PE Builder 3110a folder.

3. Obtain Windows Server 2003 Service Pack 1 versions of RAMDISK.SYS and SETUPLDR.BIN.
The Windows XP version of these files are not the same and will not work.  The two required files can be found in the Windows Server 2003 SP1 download from Microsoft.  Unfortunately it's a ~329MB download package and even though you need only these two small files that it contains you'll need to download the whole thing. The name of the downloaded file as of this writing is WindowsServer2003-KB889101-SP1-ENU.exe. Rename it to something shorter, for example WS2K3.exe, to make it easier to work with if you wish.

Once the package has downloaded DO NOT run it directly.  Doing so may create problems for your operating system. Instead from a command prompt (cmd.exe) maneuver to the directory containing the downloaded package and extract its contents to a safe location with the command

WindowsServer2003-KB889101-SP1-ENU.exe -x

or if you renamed it WS2K3.exe earlier

WS2K3.exe -x

Find RAMDISK.SY_ in the extraction directory and from the command prompt run

expand -r ramdisk.sy_ 

to get RAMDISK.SYS.  Copy the extracted RAMDISK.SYS and SETUPLDR.BIN to a safe location.

4.  Build a BartPE pebuilder.iso file in the regular manner of your choice adding whatever extra plugins or recovery and diagnostic programs you might think useful but replace the RAMDISK.SYS from Windows XP with the one obtained from Windows Server 2003 SP1. Rename the iso file PE.ISO.

5. Create a folder for the RAM-loaded BartPE project such as C:\RAM_PE. Copy both BOOTSECT.BIN from the regular BartPE directory used to create the iso and PE.ISO into the C:\RAM_PE directory. Create an i386 subdirectory inside C:\RAM_PE and copy both the NTDETECT.COM file from the i386 directory of the regular BartPE project and the SETUPLDR.BIN from Windows Server 2003 SP1 into the subdirectory. 

6. Create a WINNT.SIF file in the C:\RAM_PE directory with Notepad with the following content:

[SetupData]
BootDevice = "ramdisk(0)"
BootPath = "\i386\System32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdexportascd /rdpath=PE.ISO"


After this you should have the following contents and layout in C:\RAM_PE:

C:\RAM_PE
     ---BOOTSECT.BIN
     ---PE.ISO
     ---WINNT.SIF
     ---\i386
          ---NTDETECT.COM
          ---SETUPLDR.BIN

It is important that the file names are upper-cased and follow the 8-character DOS 8.3 format limit for file names.

7. Next step is to create the bootable to RAM iso with mkisofs.exe.  Run a command prompt as an administrator and go to the PE Builder 3110a folder (i.e. the one containing mkisofs.exe). In the command prompt run the following:

mkisofs.exe -force-uppercase -iso-level 4 -volid "BartPE" -A PEBUILDER/MKISOFS -sysid "Win32" -no-emul-boot -b BOOTSECT.BIN -o pe_ram.iso "C:\RAM_PE"

This should create pe_ram.iso.

8. Burn pe_ram.iso to a CD.  You should now have a BartPE CD that can boot to RAM.

9. For it to work as expected, make sure the system's BIOS is set so that SATA control is in IDE mode, not AHCI, and that the system boots from CD ahead of the hard disks and other media. 


Tuesday, June 24, 2014

Regular Expression to Find or Select All Characters Between Two Strings in Notepad++

Regex to search and select text or characters between two given text or character strings given String1 and String2 in Notepad++. Use recent versions of Notepad++. Older versions do not parse regular expressions for multiple lines correctly.  The following regex should also work in other software that use regular expressions.

One Line (Greedy Version)

Will select all characters between first and last instance of strings :

String1.*String2

One Line (Non-greedy Version) 

Will select all characters between first and next instance of strings :

String1.*?String2

Multiple Lines (Greedy Version)

String1(?s)(.*)String2

Multiple Lines (Alternative Regex)

String1[\s\S]*String2

Multiline Search Plugins

Two Notepad++ plugins that may help with multiline find and replace search are TextFX and ToolBucket:

TextFX → Quick → Find/Replace

ToolBucket → Multiline find and replace

Friday, May 30, 2014

How to Open or Play .XMI Files

.xmi files are an old music file format similar to the midi format that was sometimes used in older video games.  The most well-known application that opens or plays .xmi files is probably WinAmp but it is not enabled to do so by default.  One needs to change settings, configure and associate the files with WinAmp first.  Go to Options/Preferences > Plugins/Input and choose Nullsoft MIDI player. Then go to File Types and choose the exotic music files types one wants to associate with the program.  Open and play the files you want to listen to.  It may be worth it to save the files in midi format so that they will be easier to work with in the future.

Saturday, May 24, 2014

External Hard Disk Drive Enclosure Error Fix

An external IDE SATA to USB HDD enclosure can be used to connect an otherwise obsolete old IDE drive to a newer computer without a PATA/IDE port on its motherboard via USB. Unfortunately many of these devices can be pretty fragile or poorly made which causes some fairly common errors.

Hard Disk Drive Enclosure Intermittent Error or HDD Enclosure Hanging Fix 

One problem that might occur is an intermittent connection between the hard disk and the computer resulting in repeated initialization sequences and dropped connections. There are a number of possible causes but one simple remedy that is worth a shot is straightening out the wires and power connection to ensure a steady power supply to the hard disk.  Bend the wires to make sure the wires are not curling and straighten them out.  See if this reduces the disconnections and restarts and act accordingly.

Transferring Files from Old Hard Drive to New One

If one finds the setup unreliable and wants to transfer files from the old IDE drive to a newer more modern drive one should also look at the tips and use the tool in the article comparing two directories.

Paint.net 1603 Error

The paint.net 1603 error occurs during installation of the popular graphics program.  To fix this installation error make sure that the required Microsoft .NET framework is installed on your computer.  A particular version of the framework may be necessary for older paint.net versions.  Having the latest .NET Framework for example is not necessarily sufficient if the paint.net version being installed requires an older one.  In Windows check in Control Panel > Programs > Uninstall a Program and look for "Microsoft .NET Framework" to see if it is installed on your system. Installing the latest beta development build of paint.net installs the .NET framework files automatically and is probably worth trying if the stable build of paint.net refuses to install.

Wednesday, May 21, 2014

Virtual CD-ROM Control Panel

Microsoft provides a virtual CD control tool for Windows XP and supposedly Vista and Windows 7 to allow the use of ISO image files through a virtual drive. This utility comes in a self-extracting zip file winxpvirtualcdcontrolpanel_21.exe that contains 3 files: VCdControlTool.exe, VCdRom.sys, and readme.txt.

Unfortunately contrary to what is written on the download webpage, the utility seems unreliable or simply incompatible with Windows 7.  For one thing it can only work on 32-bit systems not 64-bit systems.  Installation is also fraught with pitfalls and the instructions contained in the readme.txt file do not cover most of them.  Because of this it is recommended to use a third party virtual cd-rom utility like Slysoft's Virtual CloneDrive.

If one still wishes to persist, however, here are some installation tips:

Changing to compatibility mode for Windows XP reportedly helps in some cases.

"The handle is invalid" and "Cannot Open SCM: Access is denied." errors can probably be avoided by right clicking on VCdControlTool.exe and then choosing to Run as administrator.  Turning off User Account Control is another option but doing so will leave the system less secure and is not recommended.

If in the frustrating event the Virtual CDRom Control Panel claims unable to find VCdRom.sys despite following the instructions and copying it into the Windows System32 drives folder and even clicking on it directly, try using a copy of VCdRom.sys from the install directory (default is the local temp directory) or copying VCdRom.sys into the root Windows directory and try activating that.

After adding a drive letter, one may still not see the virtual drive loaded in Windows Explorer.  The solution is to open Windows Explorer or a command prompt run as an administrator. 

Remember to mount an ISO image by selecting a .iso file.