Summary
By default, the CloudBees CD (CloudBees Flow) agent runs the cmd shells found in System32 directory which on 64-bit systems is a 64-bit cmd shell.
If you want to debug the setup of 32-bit applications, such as an CloudBees CD (CloudBees Flow) agent or encryption software, which may work different in 32-bit than 64-bit mode, you must use the 32-bit command line environment.
Solution
-
Use msinfo32.exe from a command shell to determine the OS architecture. Under the "System Summary" the field "System Type" will say 64 or 32.
-
Make sure the WOW64 package is installed on your 64-bit system.
-
When you open a cmd shell, it will be a 64-bit cmd shell.
-
Reference a direct path to the 32-bit WOW64 command shell in the step "shell" entry.
Example shell specification
%windir%\SysWoW64\cmd.exe
By default, most Windows systems use this hard coded path:
Example logic using environment variables.
C:\Windows\SysWoW64\cmd.exe
Because the cmd inherits the parents environment (the agent is running 32 bit remember) the following will detect if you are on a 64-bit system.
IF PROCESSOR_ARCHITECTURE == amd64 OR PROCESSOR_ARCHITEW6432 == amd64 THEN // OS is 64bit ELSE // OS is 32bit END IF
References
-
Information on WOW64 https://en.wikipedia.org/wiki/WOW64
-
WOW64 is optional https://learn.microsoft.com/en-us/windows/win32/win7appqual/wow64-is-now-an-optional-feature-for-server-core?redirectedfrom=MSDN
-
The example code is from https://learn.microsoft.com/en-us/archive/blogs/david.wang/howto-detect-process-bitness