No Sound in Windows Media Center

This was a puzzler and happened to me at home!  When I would boot up Windows Media Center, I no longer was getting any sound in the program (sound in Windows was working fine however). No sound in live TV or recorded TV.  However, if I opened up a regular video in the Video Library from within WMC, I would get sound!  Very odd.  Tried a System Restore, but it kept telling me it couldn’t restore files from the C: drive.  I re-setup the speakers in WMC and re-setup the tuner and still: no sound.  I then removed the sound driver and TV tuner driver and let Windows re-detect them and viola: sound was working again!

I love Windows (not).

– Soli Deo Gloria

VBScript to Replace Text in File

Here is simple and elegant VBScript code to replace plain text in a file with one word with another (poached from http://stackoverflow.com/questions/1975321/find-and-replace-string-in-my-text-with-vbscript):

If WScript.Arguments.Count <> 3 then

WScript.Echo "usage: Find_And_replace.vbs filename word_to_find replace_with "
WScript.Quit
end If

FindAndReplace WScript.Arguments.Item(0), WScript.Arguments.Item(1), WScript.Arguments.Item(2)
WScript.Echo "Operation Complete"

function FindAndReplace(strFilename, strFind, strReplace)
Set inputFile = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFilename, 1)
strInputFile = inputFile.ReadAll
inputFile.Close
Set inputFile = Nothing
Set outputFile = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFilename,2,true)
outputFile.Write Replace(strInputFile, strFind, strReplace)
outputFile.Close
Set outputFile = Nothing
end function

– Soli Deo Gloria

Imaging without an Ethernet Port

Recently, we got back a Dell XPS 13 (L321X) laptop back in stock to re-image.  It’s one of those fancy ultrabooks that turned into an ultra pain in the backside.  The laptop is so thin that putting a native Ethernet port on it would make it too big, so they just don’t do it. The only way to get a “real” Ethernet port is to use a USB to Ethernet adapter. Since we only had a handful of these units, I configured them manually by hand when they first went out.  Unfortunately, when the unit came back to us, the USB to Ethernet adapter went missing.

I had already been playing with MDT 2010’s offline media feature and this was a perfect time to test it out.  Basically, you can dump your whole MDT server to a USB flash drive and boot from it.  It will pull everything it needs (drivers, images, etc) all from the USB key and not over the network.  I had added support for the L321X a while ago, so my boot media already had all the driver support baked in.  I attempted to boot from the USB port on the right side of the laptop with my USB stick.  It booted to the deployment splash screen and then couldn’t find the deployment files.  I pulled the stick out and tried it out on a Optiplex 390 desktop.  Success!  I went back and tried the USB stick again, this time using the left side USB port and now it worked perfectly fine.  Upon booting into Windows, the left USB port worked fine, but the right one didn’t.  After contacting Dell, it was determined that there is something called the Fresco chipset that handles the right USB port and these drivers were missing.  Weird?  The right USB port was a SuperSpeed port and the left one a legacy port.  The imaging time was 21 minutes vs the normal 45 minutes by doing it over the network.

The process is pretty simple:

Go into the MDT 2010 MMC Console.  Drill to Advanced Configuration>Media.  Right-click on Media and pick New Media.  Pick a folder with lots of space (if the folder you want to use does not exist in the target location: you have to create it).  Make sure “Everything” is listed for the profile to use. Right-click MEDIA001, go to Properties and uncheck the option “Generate a Lite Touch bootable ISO image”.  Say OK and right-click MEDIA0001 again and pick Update Media Content.    Do note that this process will take a long time: be patient.

Open a command prompt (elevate as administrator)

In the command prompt window type diskpart
Type list disk
Make note of the drive number representing your USB drive.
Type select disk <#> where <#> is the number of the USB drive discovered above.
Type clean
Type create partition primary
Type select partition 1
Type active
Type format fs=ntfs quick
Type assign
Type list volume
Make note of the drive letter representing your USB drive and the CD or DVD drive.
Type exit

Now copy the contents of the Content folder (from the folder MDT created above) to the root of your USB flash drive.  Viola: boot from it and you have offline imaging magic!  I removed the x86 version of my Windows image along with the ISO to get it to fit on my 16GB flash drive.  I would recommend using a 64GB class 10 device if you plan to use this method for day to day imaging.

As of 4/29/16, the GRUB method below does not work on newer Dells such as the E5470 or E7270.  Use Rufus instead.

Note that is also possible to dump the LiteTouch ISOs directly to the USB flash drive and boot them using Grub4DOS (in case you are sick of using physical CDs to boot to LiteTouch).  However, when I did this myself, it always picked the USB flash drive as C: and assigned the real hard drive as D:.  I used a modification of the code from here to create my own USB stick: http://reboot.pro/topic/17046-help-with-mdtpe-multiboot-setup/.  I suggest doing the diskpart steps above to make sure the boot record is clean.

default 1
color NORMAL HIGHLIGHT HELPTEXT HEADING
splashimage=/fis.xpm.gz
foreground=FFFFFF
background=000000

title — Directly Bootable ISOs —
root

# Modify the following entry if it does not boot
title Windows 7 x86 LiteTouch
find –set-root –ignore-floppies –ignore-cd /LiteTouchPE_x86.iso
map –heads=0 –sectors-per-track=0 /LiteTouchPE_x86.iso (hd32)
map (hd0) (hd1)
map (hd1) (hd0)
map –hook
chainloader (hd32)

# Modify the following entry if it does not boot
title Windows 7 x64 LiteTouch
find –set-root –ignore-floppies –ignore-cd /LiteTouchPE_x64.iso
map –heads=0 –sectors-per-track=0 /LiteTouchPE_x64.iso (hd32)
map (hd0) (hd1)
map (hd1) (hd0)
map –hook
chainloader (hd32)

# Modify the following entry if it does not boot
title Windows XP ImageX
find –set-root –ignore-floppies –ignore-cd /winpe7.iso
map –heads=0 –sectors-per-track=0 /winpe7.iso (hd32)
map (hd0) (hd1)
map (hd1) (hd0)
map –hook
chainloader (hd32)

You can install Grub4DOS using the Grub4DOS GUI Installer from here: http://www.themudcrab.com/acronis_grub4dos.php.  The instructions are pretty good, but in case the web site is down: you use the GUI installer to install the GRUB4DOS boot record and then copy grldr from the grub4dos ZIP file to the root of the USB flash drive, then copy the above code into a file called menu.lst and copy that to the root of the USB flash drive as well, then you should be able to boot from it.  Grub4DOS does work with native NTFS partitions: the USB flash drive does NOT need to be FAT32 formatted.

External Hard Drives

Testing was done with external USB hard drives to see if they could be booted from as well.  The test system was an Optiplex 390 from Dell.  I tried a Seagate 750GB hard drive inserted into a StarTech Unidock.  I was not able to boot from this drive.  I then tried a WD Passport 1TB USB hard drive and I was able to boot from that, however, with both external drives, the BIOS did not see the external drive during POST until the 2nd warm boot.  I started the step from the diskpart script above starting at the select partition step (I had data on the drive I didn’t want wiped).  I was getting a NTLDR error upon boot, so I re-attached the external to the original system (running Windows 8) and ran bootsect /nt60 X: (where X: is the external hard drive) and then it booted fine on the test system.

– Soli Deo Gloria