@MichalZyzak-1432 ,
Have you installed the Office Administrative Template files (ADMX/ADML)?
If yes, please go to Group Policy Editor > User Configuration > Administrative Templates > Microsoft Office 2016 > Security Settings
, find the "Allow file extensions for OLE embedding" at right panel, check whether you have enabled the extension of "exe". Please make sure, the extension of "exe" is not enabled.
Generally, if you choose Disabled or Not Configured, or with the policy enabled but not enable "exe" extension, after double-clicking the executables, like cmd.exe, you would get the warning below.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.