September 25 2013

SCCM 2012 Programs running as 32bit on 64bit OS

I recently had a problem when I was trying to run a SCCM program (not application) that called a simple Windows command (the command was wbadmin.exe – but this is irrelevant) in SCCM 2012 on a Windows 2008 R2 64bit Operating System client. I noticed it was failing and in the execmgr.log there was a line stating “Running “C:Windows\system32\wbadmin.exe” delete systemstatebackup -keepversions:16 -quiet with 32bitLauncher” and also the Ccm32BitLauncher.log showed activity.

It was the old problem with 64bit file system redirection that I have blogged about previously.

I found a great article here – http://madluka.wordpress.com/2012/09/24/configmgr-2012-64bit-file-system-redirection-bites-again/ – that provide a batch file solution –
if the batch file is being run from within a 32bit command interpreter on a 64bit Operating System then the ‘Native’ 64bit command processor is called and re-launches the batch file. If it is already a 64bit command interpreter then the code jumps to the “:native” label and continues as usual.

So my batch file ends up looking like this, and the Program command line just calls the batch file:

IF "%PROCESSOR_ARCHITEW6432%"=="" GOTO native
%SystemRoot%\Sysnative\cmd.exe /c %0 %* Exit
:native
wbadmin delete systemstatebackup -keepversions:16 -quiet

A bit messy but there aren’t too many other option in this scenario.



----------------------------------------------------------------------------
I use a maximum of one Google Ad per post to help offset some of my blog hosting costs.

----------------------------------------------------------------------------

April 21 2010

Considerations when scripting for 64-bit machines with SCCM

As Microsoft 64-bit client Operating Systems become more common, we need to ensure we are covering all combinations when scripting in general as well as within SCCM programs. I wanted to highlight a recent situation where I couldn’t figure out why my script couldn’t write to the %systemroot%System32 folder on a 64 bit Windows 7 workstation. Then it clicked – whenever a 32-bit application attempts to access %windir%System32, the access is redirected to %windir%SysWOW64 – and don’t forget – the SCCM client is 32-bit!

32-bit applications can access the native system directory by substituting %windir%Sysnative for %windir%System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access.

There are some good references here, here and here.

As a separate but related topic, I think it’s worthwhile pointing out this relatively new post at MyITForum that relates to UNC paths within batch files. Most people will tell you that UNC paths are not supported in a batch file – well that isn’t necessarily the case – “%~dp0” is a variable that can be used in your batch file that will give you the full UNC path of where your script is being run from. From more info, see this post http://www.myitforum.com/absolutenm/templates/Articles.aspx?articleid=15520&zoneid=87