If you want to run a script using 32bit com components in a 64bit environment, you need to use the correct cscript.exe to run the script. Try using %WINDOWS%\SysWOW64\cscript.exe for backwards compatibility.

The WSF file works (connect to the HFM application, etc..) but when we execute this wsf from fdm script using Shell object, then we get the same error as executing the code directly from the fdm script.