ConfigMgr – x86 vs x64 – package
Running a batch-file, be it .bat or .cmd in ConfigMgr (MEMCM) – there are things you need to know.
If your Program in your Package is just Run-This-File.cmd then it’ll be executed in a 32-bit cmd.exe process.
And then, if you look for %ProgramFiles% in your batch file, it’ll just give you Program Files (x86) instead of the one you expect. The 64-bit one.
Hence – If you want to run a cmd.exe in all 64-bit then do this in your package/program in ConfigMgr:
%WINDIR%\SYSNATIVE\cmd.exe /C Run-This-File.cmd
This will execute in 64-bit and your batch-file will have all the usual variables available as if you run your cmd, normally.