'Intel(R) Visual Fortran run-time error on elevated permissions for DISM

I have written a simple Fortran code as follows:

!call system ('dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart')
call execute_command_line ('dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart')
end

When I run it using Intel(R) Visual Fortran compiler with Visual Studio, I am getting following error message:

Error: 740

Elevated permissions are required to run DISM.
Use an elevated command prompt to complete these tasks.

Any suggestion please to overcome this.

Thank you very much in advance for your time and help in this matter,

Bakbergen



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source