Run a Certain Command Line Based on x86 or x64 Architecture

I’ve published about running certain files based on the operating system type (see this posting about such VBScript code on my blog), but what if you want to run something based on processor type, i.e. x86 or x64?  The “problem” with VBScript is that it can be hell on earth dealing with command lines that involve quotes and switches.  How about a simple batch file instead?

@echo off

Set RegQry=HKLM\Hardware\Description\SystemCentralProcessor

REG.exe Query %RegQry% > checkOS.txt

Find /i "x86" < CheckOS.txt > StringCheck.txt

If %ERRORLEVEL% == 0 (
Echo "This is 32 Bit Operating system"
) ELSE (
Echo "This is 64 Bit Operating System"
)

Stolen from http://support.microsoft.com/kb/556009.  It’s beautiful, simple and gets the job done. You can just stick your command lines as they are between the ( )’s.  Here’s a sample of something I did for the push out of Creo Parametric 2.0:

@echo off

Set RegQry=HKLM\Hardware\Description\System\CentralProcessor

REG.exe Query %RegQry% > checkOS.txt

Find /i "x86" < CheckOS.txt > StringCheck.txt

If %ERRORLEVEL% == 0 (
"C:\creo 2.0\Common Files\M040\install\addon\creoagent_32.msi" /passive
) ELSE (
"C:\creo 2.0\Common Files\M040\install\addon\creoagent_32_64.msi" /passive
)

Of course, it would be much simpler to dump Windows XP and every 32-bit operating system known to man.  If you have multiple lines, you will probably want to use something like start /w to wait for each line to finish, otherwise it will run every line all in one go.

– Soli Deo Gloria

Windows Blue Might Restore Start Menu

Did Microsoft finally wake up?  Let’s hope so.  This change would restore some of my faith back in Microsoft.

http://arstechnica.com/information-technology/2013/04/windows-blue-could-restore-the-start-button-boot-straight-to-the-desktop/

To quote Winbeta.org:

For those upgrading to Windows Blue, you might now have the option to remove the Start Screen. According to the report, after examining the code in twinui.dll, there is a line that is “responsible for disabling the Start Screen” and after disabling or modifying the code it makes the system “go to the desktop automatically.” Those using Windows 8 or the leaked Windows 8.1 build, you will obviously know by now that this option isn’t yet available.

From http://www.winbeta.org/news/microsoft-possibly-working-letting-user-disable-start-screen

– Soli Deo Gloria

When VMs Won’t Cut It

I was recently working with Creo Parametric (3d modeling software).  Unfortunately, my VMs are not powerful enough to run this software.  Solution?  Steader State.  Basically, this software let’s you do a P2V conversion and then by using the VHD boot feature of Windows 7 Ultimate/Enterprise, it will create a difference VHD to your base VHD.   Upon booting Windows 7, you get two options: Rollback Windows and Windows 7.   Pick roll back Windows 7 and bingo: you’re back to a clean state!  This does require wiping out the contents of your C: drive however, so you will want to do this on a second box.

Update #1:

I found something better/easy for this process: Reboot Restore Rx (http://www.horizondatasys.com/en/products_and_solutions.aspx?ProductId=18).  Only tested on XP, but it works great!  You can toggle it on and off from the taskbar.

– Soli Deo Gloria